Skip to content
Browse files

added redirect for main domain

  • Loading branch information...
1 parent 9f7004c commit 2d008b1f3ff6ae622d31c6e4e3068c1a5ad739dc @sunchess committed Feb 21, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 app/controllers/application_controller.rb
View
8 app/controllers/application_controller.rb
@@ -1,6 +1,6 @@
class Time
def get_month
- self.strftime("%m").to_s.delete("0").to_i
+ self.strftime("%m").to_s.delete("0").to_i
end
end
@@ -11,6 +11,8 @@ class ApplicationController < ActionController::Base
helper_method :current_discount
helper_method "admin?"
+ before_filter :domain_redirect
+
rescue_from CanCan::AccessDenied do |exception|
if user_signed_in?
@@ -21,6 +23,10 @@ class ApplicationController < ActionController::Base
end
end
+ def domain_redirect
+ redirect_to 'http://coastsun.ru' if ['gdedk.ru', 'www.gdedk.ru', 'www.coastsun.ru'].include?(request.env["HTTP_HOST"])
+ end
+
private
def admin?
user_signed_in? && current_user.admin?

0 comments on commit 2d008b1

Please sign in to comment.
Something went wrong with that request. Please try again.