comfortable-mexican-sofa
comfortable-mexican-sofa copied to clipboard
'around action' breaking admin CMS
My application controller has an 'around_action' call to change the locale, but it is breaking the admin cms and keeping the page from rendering, any idea why this is a problem?
class ApplicationController < ActionController::Base
around_action :set_locale
def set_locale(&action)
I18n.with_locale(params[:lang1], &action)
end
..
end
Late to the party, but out of curiosity, why not set it in general as in I18n.locale = params[:lang1]
?
I've personally had difficulties with full request around_actions
for setting time zone and locales as you've noticed here. It also messes with the stack trace making debugging difficult in instances.