Update action_view_overview.md

This commit is contained in:
André Galatti Faria 2019-07-25 11:34:10 -03:00 committed by GitHub
parent 1a0e9f5125
commit 1816348f7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1048,7 +1048,7 @@ To access the passed options programatically (e.g. adding a custom class if chec
```html+erb ```html+erb
<%= collection_radio_buttons(:article, :author_id, Author.all, :id, :name_with_initial, {checked: Author.last, required: true} do |rb| %> <%= collection_radio_buttons(:article, :author_id, Author.all, :id, :name_with_initial, {checked: Author.last, required: true} do |rb| %>
<%= rb.label(class: "#{'my-custom-class' if rb.instance_values['input_html_options'][:checked]}") { rb.radio_button + rb.text } %> <%= rb.label(class: "#{'my-custom-class' if rb.value == Author.last.id}") { rb.radio_button + rb.text } %>
<% end %> <% end %>
``` ```