title: How to solve the "Can't mass-assign protected attributes: translations_attributes" error?
body: <p>I am using Ruby on Rails (3.2.2), <a href="https://github.com/svenfuchs/globalize3" rel="nofollow">globalize3</a> (0.2.0) and <a href="https://github.com/fidel/batch_translations" rel="nofollow">batch_translations</a> (0.1.2) ruby-gems. I would like to solve the following problem generated when using the batch_translations ruby-gem:</p>
  
  <pre><code>ActiveModel::MassAssignmentSecurity::Error in Admin::ArticlesController#update
  
  Can't mass-assign protected attributes: translations_attributes
  </code></pre>
  
  <p>In my <code>ROOT_RAILS/Gemfile</code> file I have:</p>
  
  <pre><code>...
  gem 'globalize3'
  gem 'batch_translations'
  </code></pre>
  
  <p>In my <code>ROOT_RAILS/app/models/admin/article.rb</code> file I have:</p>
  
  <pre><code>class Admin::Article &lt; ActiveRecord::Base
    translates :title
  
    # This is needed to make the batch_translations to work.
    accepts_nested_attributes_for :translations
  
    ...
  end
  </code></pre>
  
  <p>In my <code>ROOT_RAILS/app/views/admin/articles/_form.html.erb</code> file I have:</p>
  
  <pre><code>&lt;%= form_for(@admin_article, :url =&gt; admin_article_path) do |f| %&gt;
      &lt;%= f.label :title %&gt;&lt;br /&gt;
      English translation:
      &lt;%= f.text_field :title %&gt;
  
      Italiano translation:
      &lt;%
        # Note: I am using the '&lt;%= f...' instad of '&lt;% f...' otherwise
        # batch_translations doesn't output the input field in the
        # front-end content.
      %&gt;
      &lt;%= f.globalize_fields_for :it do |g| %&gt;
        &lt;%= g.text_field :title %&gt;
      &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>In my <code>ROOT_RAILS/app/controllers/admin/articles_controller.html.erb</code> file I have:</p>
  
  <pre><code>class Admin::ArticlesController &lt; ApplicationController
  
    def update
      @admin_article = Article.find(params[:id])
  
      respond_to do |format|
        if @admin_article.update_attributes(params[:article])
          format.html { redirect_to admin_article_path(@admin_erticle), notice: 'Article was successfully updated.' }
          format.json { head :no_content }
        else
          format.html { render action: "edit" }
          format.json { render json: @admin_article.errors, status: :unprocessable_entity }
        end
      end
    end
  
    ...
  end
  </code></pre>
  
  <p><em>When I show the edit form all works, but when I submit that form I get the error mentioned above.</em> <strong>How can I solve the above error?</strong></p>
  
  <hr>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found the solution by using the following code in the <code>ROOT_RAILS/app/models/admin/article.rb</code> file:</p>
  
  <pre><code>class Admin::Article &lt; ActiveRecord::Base
    translates :title
  
    attr_accessible :translations_attributes
    accepts_nested_attributes_for :translations
  
    ...
  end
  </code></pre>
  
  <p><strong>... but making the <code>:translations_attributes</code> accessible is it sure?</strong></p>