ActionView::Helpers::FormOptionsHelper
module ActionView::Helpers::FormOptionsHelper
Provides a number of methods for turning different kinds of containers into a set of option tags.
The collection_select
, select
and time_zone_select
methods take an options
parameter, a hash:
-
:include_blank
- set to true or a prompt string if the first option element of the select element is a blank. Useful if there is not a default value required for the select element.select("post", "category", Post::CATEGORIES, {include_blank: true})
could become:
<select name="post[category]"> <option></option> <option&