instance method
collection_radio_buttons
Ruby on Rails 8.1.2
Since v4.0.13Signature
collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
Wraps ActionView::Helpers::FormOptionsHelper#collection_radio_buttons for form builders:
<%= form_with model: @post do |f| %>
<%= f.collection_radio_buttons :author_id, Author.all, :id, :name_with_initial %>
<%= f.submit %>
<% end %>
Please refer to the documentation of the base helper for details.
Parameters
-
methodreq -
collectionreq -
value_methodreq -
text_methodreq -
optionsopt = {} -
html_optionsopt = {} -
blockblock
Source
# File actionview/lib/action_view/helpers/form_options_helper.rb, line 924
def collection_radio_buttons(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
@template.collection_radio_buttons(@object_name, method, collection, value_method, text_method, objectify_options(options), @default_html_options.merge(html_options), &block)
end
Defined in actionview/lib/action_view/helpers/form_options_helper.rb line 924
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::FormBuilder