diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 581285b..baba889 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,5 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery + layout :layout_by_resource # Setup the locale based on the domain name used to access the website before_filter :set_locale @@ -12,4 +13,9 @@ class ApplicationController < ActionController::Base this_domain_ext = request.host.split('.').last I18n.locale = params[:locale] || DEFAULT_LANGUAGE_BY_DOMAIN[this_domain_ext] || 'en' end + + # Selects a layout different from layouts/application for some special pages. + def layout_by_resource + devise_controller? ? 'login' : 'application' + end end diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index d0d70c5..3a3befa 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,11 +1,3 @@ -