Skip to content

Commit

Permalink
added redirect for main domain
Browse files Browse the repository at this point in the history
  • Loading branch information
sunchess committed Feb 21, 2012
1 parent 9f7004c commit 2d008b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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

Expand All @@ -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?
Expand All @@ -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?
Expand Down

0 comments on commit 2d008b1

Please sign in to comment.