Search code examples
rubycontrollertranslationglobalize2

Globalize3 module translation for database


I got an issue with Globalize3, i have build a module to add translations in Admin for Preferences User

I display each translation by her ID and her locale. But i don't understand why the locale is not define when i want to display the page.

The gist for better show : https://gist.github.com/266562670cd8dab28548#gistcomment-43681

Thanks for your help

Fixed.


Solution

  • If you have a look at the params you are getting in the update action for the perference topic translation (just raise params[:preference_topic_translation]). You'll notice you probably have preference_topic_option_translation coming through as one of the attributes which doesn't exist on the model.

    You need to update line #12 in the form:

    <%= f.fields_for preference_topic_option_translation do |translate_form| %>
    

    It should read:

    <%= f.fields_for :preference_topic_option_translations, preference_topic_option_translation do |translate_form| %>