Ray
Ray

Reputation: 349

Rails turning select to checkbox acts_as_taggable_on

I have the following select form which works. I want to turn it into a checkbox. I've tried it for a while but to no avail. I'd appreciate your help

<%= f.select :tag_list, Artist.tag_counts_on(:tag), {}, {:multiple => true, :class => "tags-select", selected: :tag_list } %>

Upvotes: 2

Views: 238

Answers (1)

Pavan
Pavan

Reputation: 33542

Something like below should do

<% Artist.tag_counts_on(:tag).each do |some_value| %>
  <%= f.check_box(:tag_list, { :multiple => true }, some_value, nil) %>
<% end %>

Upvotes: 2

Related Questions