I am developing a Rails application with ActiveAdmin and I am using I18n.js for js translations.
Problem is that for I8n.js to work, I have to set the language in each .erb as follows:
<script type="text/javascript"> I18n.defaultLocale = "<%= I18n.default_locale %>"; I18n.locale = "<%= I18n.locale %>"; </script>
The witch works fine in the rest of the application (if I put it in the application.erb file), but I cannot find a global location so that it can be used for all my ActiveAdmin forms.
I really don't want to repeat the code in every form or change the default erb (if possible).
So, is there a way to share some erb code in all views?
Thanks!
source share