method
collection_select
v8.0.0 -
Show latest stable
- Class:
ActionView::Helpers::FormBuilder
collection_select(method, collection, value_method, text_method, options = {}, html_options = {})public
Wraps ActionView::Helpers::FormOptionsHelper#collection_select for form builders:
<%= form_with model: @post do |f| %> <%= f.collection_select :person_id, Author.all, :id, :name_with_initial, prompt: true %> <%= f.submit %> <% end %>
Please refer to the documentation of the base helper for details.