Multiple select issue with a HABTM relationship using Rails 4

Although the code seems to be right, when I try to send the form, the
values of the multiple select aren’t being sent.If I just remove the
multiple option, everything works as expected considering just one
value,
but it’s important to store more than one tag per transaction.

Do you have any ideas about what could be happening here?

Model

Transaction.rb

class Transaction < ActiveRecord::Base
has_and_belongs_to_many :tags

Tag.rb

class tag < ActiveRecord::Base
has_and_belongs_to_many :transactions

View

<%= form.collection_select :tag_ids, @tags, :id, :name, {},
{:multiple => true} %>

Result:



On Fri, Jul 19, 2013 at 5:52 AM, Diego C. [email protected]
wrote:

Although the code seems to be right, when I try to send the form, the values
of the multiple select aren’t being sent.

Are you sure about that? Check the log output from submitting the
form.


Hassan S. ------------------------ [email protected]

twitter: @hassan