title: Mass assignment error in nested form in Rails
body: <p><code>transaction.rb</code> model:</p>
  
  <pre><code>class Transaction &lt; ActiveRecord::Base
    attr_accessible :customer, :tickets_attributes
    has_many :tickets
    accepts_nested_attributes_for :tickets
  end
  </code></pre>
  
  <p><code>ticket.rb</code> model:</p>
  
  <pre><code>class Ticket &lt; ActiveRecord::Base
    attr_accessible :booking_id, :quantity, :transaction_id
    belongs_to :transaction
    belongs_to :booking
  end
  </code></pre>
  
  <p>in the view page i have a nested rails form for multiple entries of <code>ticket</code>:</p>
  
  <pre><code>&lt;%= form_for(@transaction) do |f| %&gt;
    &lt;%= f.text_field :customer %&gt;
  
    &lt;% @sezzion.bookings.each do |booking| %&gt;
        &lt;%= booking.bookingdate %&gt;:
  
        &lt;%= f.fields_for :ticket do |t| %&gt;
           &lt;%= t.text_field :quantity, :value =&gt; 0, :class =&gt; "quantity" %&gt;
           &lt;%= t.hidden_field :booking_id, :value =&gt; booking.id %&gt;
        &lt;% end %&gt;
  
    &lt;% end %&gt;
    &lt;%= f.submit "create transaction" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>When I'm submitting the form, I have the following error:</p>
  
  <pre><code>ActiveModel::MassAssignmentSecurity::Error in TransactionsController#create
  Can't mass-assign protected attributes: ticket
  </code></pre>
  
  <p>I have <code>attr_accessible :tickets_attributes</code> and <code>accepts_nested_attributes_for :tickets</code> in the <code>transaction</code> model and there's still an error. Also when I add plural to the ticket on line <code>&lt;%= f.fields_for :ticket do |t| %&gt;</code>, the <code>quantity</code> field doesn't display.</p>