select(method, choices, options = {}, html_options = {}) public

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.

Show source
Register or log in to add new notes.