Add a class to a label, bootstrap

384 views
Skip to first unread message

Seal

unread,
Jun 9, 2013, 6:40:25 AM6/9/13
to plataformate...@googlegroups.com
I want to accomplish the following:

  • <label class="checkbox inline">
  • <input type="checkbox" id="inlineCheckbox1" value="option1"> 1
  • </label>

  • <label class="checkbox inline">
  • <input type="checkbox" id="inlineCheckbox2" value="option2"> 2
  • </label>


Note the extra inline class added to the labels. How can I do such thing with Simpleform + Bootstrap?

Thanks

Vasiliy Ermolovich

unread,
Jun 9, 2013, 7:07:12 AM6/9/13
to plataformate...@googlegroups.com
Hi,

If you're using collection input you can use `:item_wrapper_class`:

f.input :foo, :collection => foo_collection, :as => :check_boxes, :item_wrapper_class => 'inline'

Seal wrote:

I want to accomplish the following:

# <labelclass="checkbox inline">
# <inputtype="checkbox"id="inlineCheckbox1"value="option1">1
# </label>
#

# <labelclass="checkbox inline">
# <inputtype="checkbox"id="inlineCheckbox2"value="option2">2
# </label>


Note the extra */inline/* class added to the labels. How can I do such
thing with Simpleform + Bootstrap?

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/groups/opt_out.

Seal

unread,
Jun 9, 2013, 10:54:09 PM6/9/13
to plataformate...@googlegroups.com
Thank you much, this took care of it! :)

Where would I find documentation for that method? I'm new with Ruby in general (coming from PHP) and I have hard time finding documentation for the gems and even Rails itself.

On Sunday, June 9, 2013 4:07:12 AM UTC-7, Vasiliy Ermolovich wrote:
Hi,

If you're using collection input you can use `:item_wrapper_class`:

f.input :foo, :collection => foo_collection, :as => :check_boxes, :item_wrapper_class => 'inline'

Seal wrote:

I want to accomplish the following:

# <labelclass="checkbox inline">
# <inputtype="checkbox"id="inlineCheckbox1"value="option1">1
# </label>
#

# <labelclass="checkbox inline">
# <inputtype="checkbox"id="inlineCheckbox2"value="option2">2
# </label>


Note the extra */inline/* class added to the labels. How can I do such
thing with Simpleform + Bootstrap?

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

Dheeraj Kumar

unread,
Jun 10, 2013, 12:15:33 AM6/10/13
to plataformate...@googlegroups.com

-- 
Dheeraj Kumar

To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages