instance method
collection_checkboxes
Ruby on Rails 8.1.2
Since v8.0.4Available in: v8.0.4 v8.1.2
Signature
collection_checkboxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
Wraps ActionView::Helpers::FormOptionsHelper#collection_checkboxes for form builders:
<%= form_with model: @post do |f| %>
<%= f.collection_checkboxes :author_ids, 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 911
def collection_checkboxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
@template.collection_checkboxes(@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 911
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::FormBuilder