Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to style checkboxes / radios as buttons? #132

Open
cdekker opened this issue Aug 15, 2014 · 3 comments
Open

Possible to style checkboxes / radios as buttons? #132

cdekker opened this issue Aug 15, 2014 · 3 comments

Comments

@cdekker
Copy link

cdekker commented Aug 15, 2014

Is there an easy way to implement the snippit mentioned here about radio buttons:
http://getbootstrap.com/javascript/#buttons

I have my radio's defined, but I cant seem to access the class of the label that surrounds the radio button input.

@potenza
Copy link
Member

potenza commented Aug 21, 2014

@cdekker Right now we don't support this sort of thing, but it looks useful as I've written my own set of controls like this and Bootstrap's are so much simpler. I was trying to hack around the library and this is the best I can come up with right now (basically just skipping our library altogether):

<%= f.form_group do %>
  <%= f.errors_on :misc %>
  <div class="btn-group" data-toggle="buttons">
    <label class="btn btn-primary active">
      <%= f.radio_button_without_bootstrap :misc, "option1" %> Option 1
    </label>
    <label class="btn btn-primary">
      <%= f.radio_button_without_bootstrap :misc, "option2" %> Option 2
    </label>
    <label class="btn btn-primary">
      <%= f.radio_button_without_bootstrap :misc, "option3" %> Option 3
    </label>
  </div>
<% end %>

@soullivaneuh
Copy link

👍 This features could be very useful.

Did you plan when you'll add this to your lib?

Thanks.

@donv
Copy link
Collaborator

donv commented Sep 8, 2023

I guess this is the wanted feature: https://getbootstrap.com/docs/5.3/forms/checks-radios/#toggle-buttons

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants