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

label option for CheckBoxComponent & RadioButtonComponent #16

Open
Spone opened this issue Jun 26, 2021 · 2 comments
Open

label option for CheckBoxComponent & RadioButtonComponent #16

Spone opened this issue Jun 26, 2021 · 2 comments
Labels
discussion Let's discuss ideas and features

Comments

@Spone
Copy link
Collaborator

Spone commented Jun 26, 2021

Instead of writing:

= f.label :admin
= f.check_box :admin

= f.label :civility, value: "mr"
= f.radio_button :civility, "mr"
= f.label :civility, value: "mrs"
= f.radio_button :civility, "mrs"

you could write:

= f.check_box :admin, label: true

= f.radio_button :civility, "mr", label: true
= f.radio_button :civility, "mrs", label: true
@Spone
Copy link
Collaborator Author

Spone commented Jun 26, 2021

Or maybe it would be better to do it with a group component...

= f.group :admin
  = f.check_box :admin

But in the case of radio buttons, we want 1 radio button = 1 label (and no <label> in the group, just the label text). How to do that? Use nested groups?

= f.group :civility, label: false
  = f.group :civility, value: "mr"
    = f.radio_button :civility, "mr"
  = f.group :civility, value: "mr"
    = f.radio_button :civility, "mrs"

@Spone Spone added the discussion Let's discuss ideas and features label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Let's discuss ideas and features
Projects
None yet
Development

No branches or pull requests

1 participant