<div class="input check_boxes optional"> <label class="check_boxes optional" for="article_category_ids"> Category ids</label> <span> <label for="article_category_ids_4"> <input id="article_category_ids_4" name="article[category_ids][]" type="checkbox" value="4" />agile</label> </span>
<div class="form-group check_boxes optional order_option_ids"> <label class="check_boxes optional control-label" for="order_option_ids"> Health potion option ids</label> <span> <label for="order_option_ids_2"> <label for="order_option_ids_2"> <input type="checkbox" value="2" name="order[health_potion_option_ids][]" id="order_option_ids_2">Add more caffeine </label> </label> </span>
I am doing this, as stated above but I am getting double labels:
<%= f.input :category_ids, :as => :check_boxes do %> <%= f.collection_check_boxes :category_ids, Category.order(:name), :id, :name do |b| b.label { b.check_box + b.text } end %> <% end %>
According to this: https://github.com/plataformatec/simple_form/issues/452#issuecomment-3954313 it should work but it doesn't in the way shown.
I'm using: Simple Form 3.1.0 on Rails 4.2. Help is much appreciated.
THanks
--
You received this message because you are subscribed to the Google Groups "SimpleForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "SimpleForm" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plataformatec-simpleform/8g--5ne_Z4k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plataformatec-simp...@googlegroups.com.
On Tue, Mar 17, 2015 at 10:41 AM, Carlos Antonio da Silva <carlosanto...@gmail.com> wrote:
You received this message because you are subscribed to a topic in the Google Groups "SimpleForm" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plataformatec-simpleform/8g--5ne_Z4k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plataformatec-simp...@googlegroups.com.
<%= f.input :option_ids, :as => :check_boxes, wrapper_html: { class: 'btn-group', 'data-toggle' => "buttons"} do %> <%= f.collection_check_boxes :option_ids, HealthPotionOption.order(:price), :id, :name, boolean_style: :inline, item_wrapper_tag: nil do |b| %> <%= b.label(class: "btn btn-primary", html: "was") { "<span class='option_name'> #{b.object.name} </span>".html_safe + "<span class='option_description'> #{b.object.description} </span>".html_safe + "<span class='option_price'> #{b.object.price} </span>".html_safe} %> <% end %> <% end %>