passing array to f.select ruby on rails
<p>On my rails application in the views/cards/_form i have the code for a f.select field:</p>

<pre><code>&lt;%= f.select :tag_speciality, options_for_select(@subdomain.tag_speciality), {}, {class: 'form-control'} %&gt;
</code></pre>

<p>That give me the output:</p>

<pre><code>&lt;select class="form-control" name="card[tag_speciality]" id="card_tag_speciality"&gt;
  &lt;option value="Professor de Yoga"&gt;Professor de Yoga&lt;/option&gt;
  &lt;option value="Professora de Yoga"&gt;Professora de Yoga&lt;/option&gt;
  &lt;option value="Estúdio de Yoga"&gt;Estúdio de Yoga&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>In my migration file i have:</p>

<pre><code>add_column :cards, :tag_speciality, :string, array: true
</code></pre>

<p>When i go to the form and select any option, for example, "Professor de Yoga", and save, i get the result:</p>

<pre><code>[]
</code></pre>

<p>instead of:</p>

<p><code>["Professor de Yoga"]</code></p>

<p>This is my controller:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>  def index
    @cards = Card.all
  end

  def create
    @card = @user.cards.new card_params

    respond_to do |format|
      if @card.save
        format.html { redirect_to cards_from_subdomain_path(@subdomain.id), notice: 'Card was successfully created.' }
        format.json { render :show, status: :created, location: @card }
      else
        format.html { render :new }
        format.json { render json: @card.errors, status: :unprocessable_entity }
      end
    end
  end

  def update
    respond_to do |format|
      if @card.update(card_params)
        format.html { redirect_to cards_from_subdomain_path(@subdomain.id), notice: 'Card was successfully updated.' }
        format.json { render :show, status: :ok, location: @card }
      else
        format.html { render :edit }
        format.json { render json: @card.errors, status: :unprocessable_entity }
      end
    end
  end
 
  # Never trust parameters from the scary internet, only allow the white list through.
  def card_params
    params.require(:card).permit(
      :name,
      :phone,
      :email,
      :cover,
      :is_published,
      :subdomain_id,
      :domain_id,
      :profile_id,
      :is_solidarity,
      :tag_speciality,
      :tag_location,
      user_id: []
    )
  end
end</code></pre>
</div>
</div>
</p>

<p>Is there anything that am i missing?
Thanks</p>