instance method
select
Ruby on Rails 4.0.13
Since v2.2.3Signature
select(method, choices, options = {}, html_options = {})
Wraps ActionView::Helpers::FormOptionsHelper#select for form builders:
<%= form_for @post do |f| %>
<%= f.select :person_id, Person.all.collect {|p| [ p.name, p.id ] }, { include_blank: true } %>
<%= f.submit %>
<% end %>
Please refer to the documentation of the base helper for details.
Parameters
-
methodreq -
choicesreq -
optionsopt = {} -
html_optionsopt = {}
Source
# File actionpack/lib/action_view/helpers/form_options_helper.rb, line 773
def select(method, choices, options = {}, html_options = {})
@template.select(@object_name, method, choices, objectify_options(options), @default_options.merge(html_options))
end
Defined in actionpack/lib/action_view/helpers/form_options_helper.rb line 773
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::FormBuilder