STYLIZE :as => :radio USING Bootstrap radio buttons

254 views
Skip to first unread message

Ritvvij Parrikh

unread,
May 23, 2012, 11:26:26 PM5/23/12
to SimpleForm
I am using Twitter Bootstrap and Simple form in rails app.

I want to stylize

= f.input :genre, :as => :radio, :collection => [["Business", "UG_B"],
["Registered charity", "UG_C"], ["Individual", "UG_P"]], :label =>
"You are a", :required => true

using

http://twitter.github.com/bootstrap/javascript.html#buttons --> Radio
buttons (Look at the example Left, Middle, Right

<div class="btn-group" data-toggle="buttons-radio">
%button.btn
<button class="btn">Left</button>
<button class="btn">Middle</button>
<button class="btn">Right</button>
</div>

Any suggestions on how this can be achieved? Thank you in advance.

Abram

unread,
May 24, 2012, 1:34:36 AM5/24/12
to plataformate...@googlegroups.com
probably :html => { :data-toggle => "buttons-radio" }

Ritvvij Parrikh

unread,
May 24, 2012, 3:12:32 AM5/24/12
to SimpleForm
Does not work.Even tried:

%div{ "data-toggle" => "buttons-radio", :class => "btn-group" }=
f.input :genre, :as => :radio, :collection => [["Business", "UG_B"],
["Registered charity", "UG_C"], ["Individual", "UG_P"]], :label =>
"You are a", :required => true, :input_html => {:class => "btn"}

Any other suggestions

On May 24, 10:34 am, Abram <funkdif...@gmail.com> wrote:
> probably :html => { :data-toggle => "buttons-radio" }
>
>
>
>
>
>
>
> On Thu, May 24, 2012 at 3:26 PM, Ritvvij Parrikh <ritvi...@gmail.com> wrote:
> > I am using Twitter Bootstrap and Simple form in rails app.
>
> > I want to stylize
>
> > = f.input :genre, :as => :radio, :collection => [["Business", "UG_B"],
> > ["Registered charity", "UG_C"], ["Individual", "UG_P"]], :label =>
> > "You are a", :required => true
>
> > using
>
> >http://twitter.github.com/bootstrap/javascript.html#buttons--> Radio

Abram

unread,
May 24, 2012, 3:14:23 AM5/24/12
to plataformate...@googlegroups.com
What do you get as html output from that?
Reply all
Reply to author
Forward
0 new messages