From 18a17014725bc0a42b8459808fc848fe277a607f Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 29 Nov 2013 21:37:25 +0800 Subject: [PATCH] Fixed Default Locale --- app/controllers/admin/sites_controller.rb | 16 +++++++++------- app/views/admin/sites/preference.html.erb | 2 -- config/environments/production.rb | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index 4b9ee149..496f77a1 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -21,7 +21,9 @@ class Admin::SitesController < OrbitBackendController end def update - params[:site][:defalut_locale] = nil if params[:site][:default_locale].blank? + if params[:site][:enable_language_detection] + Site.update_all({:default_locale => nil}) + end @site.update_attributes(params[:site]) redirect_to :back end @@ -72,12 +74,12 @@ class Admin::SitesController < OrbitBackendController end - def reset_default_locale - @site.defalut_locale = params[:default_locale] - if @site.save - render :nothing => true - end - end + # def reset_default_locale + # @site.defalut_locale = params[:default_locale] + # if @site.save + # render :nothing => true + # end + # end def change_design design = Design.find(params[:site_id]) rescue nil diff --git a/app/views/admin/sites/preference.html.erb b/app/views/admin/sites/preference.html.erb index 02b2a275..1e4fadf2 100644 --- a/app/views/admin/sites/preference.html.erb +++ b/app/views/admin/sites/preference.html.erb @@ -262,7 +262,6 @@ delete locales; > -<% content_for :page_specific_javascript do %> -<% end %>