Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #application.rb
  2. config.i18n.default_locale = :nl
  3. config.i18n.available_locales = [:en, :nl]
  4.  
  5. before_filter :set_locale
  6. def set_locale
  7. if [RailsAdmin].include?(self.class.parent)
  8. I18n.locale = :en
  9. else
  10. I18n.locale = params[:locale] || I18n.default_locale
  11. end
  12. end
  13.  
  14. #/config/initializers/rails_admin.rb
  15. RailsAdmin.config do |config|
  16. config.parent_controller = '::ApplicationController'
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement