--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: Returns a set of select tags (one for year, month, and day) pre-selected for accessing a specified date-based attribute (identified by <tt>method</tt>) on an object assigned to the template (identified by <tt>object</tt>). You can the output in the <tt>options</tt> hash.
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Options
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:use_month_numbers</tt> - Set to true if you want to use month numbers rather than month names (e.g.
  - !ruby/struct:SM::Flow::VERB 
    body: " &quot;2&quot; instead of &quot;February&quot;).\n"
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:use_short_month</tt> - Set to true if you want to use the abbreviated month name instead of the full name (e.g. &quot;Feb&quot; instead of &quot;February&quot;).
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:add_month_number</tt> - Set to true if you want to show both, the month's number and name (e.g. &quot;2 - February&quot; instead of &quot;February&quot;).
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: "<tt>:use_month_names</tt> - Set to an array with 12 month names if you want to customize month names. Note: You can also use Rails' new i18n functionality for this."
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:date_separator</tt> - Specifies a string to separate the date fields. Default is &quot;&quot; (i.e. nothing).
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:start_year</tt> - Set the start year for the year select. Default is <tt>Time.now.year - 5</tt>.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:end_year</tt> - Set the end year for the year select. Default is <tt>Time.now.year + 5</tt>.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:discard_day</tt> - Set to true if you don't want to show a day select. This includes the day as a hidden field instead of showing a select field. Also note that this implicitly sets the day to be the first of the given month in order to not create invalid dates like 31 February.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:discard_month</tt> - Set to true if you don't want to show a month select. This includes the month as a hidden field instead of showing a select field. Also note that this implicitly sets :discard_day to true.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:discard_year</tt> - Set to true if you don't want to show a year select. This includes the year as a hidden field instead of showing a select field.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:order</tt> - Set to an array containing <tt>:day</tt>, <tt>:month</tt> and <tt>:year</tt> do customize the order in which the select fields are shown. If you leave out any of the symbols, the respective select will not be shown (like when you set <tt>:discard_xxx =&gt; true</tt>. Defaults to the order defined in the respective locale (e.g. [:year, :month, :day] in the en locale that ships with Rails).
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:include_blank</tt> - Include a blank option in every select field so it's possible to set empty dates.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:default</tt> - Set a default date if the affected date isn't set or is nil.
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>:disabled</tt> - Set to true if you want show the select fields as disabled.
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: If anything is passed in the <tt>html_options</tt> hash it will be applied to every select tag in the set.
- !ruby/struct:SM::Flow::P 
  body: "NOTE: Discarded selects will default to 1. So if no month select is available, January will be assumed."
- !ruby/struct:SM::Flow::H 
  level: 4
  text: Examples
- !ruby/struct:SM::Flow::VERB 
  body: "  # Generates a date select that when POSTed is stored in the post variable, in the written_on attribute\n  date_select(&quot;post&quot;, &quot;written_on&quot;)\n\n  # Generates a date select that when POSTed is stored in the post variable, in the written_on attribute,\n  # with the year in the year drop down box starting at 1995.\n  date_select(&quot;post&quot;, &quot;written_on&quot;, :start_year =&gt; 1995)\n\n  # Generates a date select that when POSTed is stored in the post variable, in the written_on attribute,\n  # with the year in the year drop down box starting at 1995, numbers used for months instead of words,\n  # and without a day select box.\n  date_select(&quot;post&quot;, &quot;written_on&quot;, :start_year =&gt; 1995, :use_month_numbers =&gt; true,\n                                    :discard_day =&gt; true, :include_blank =&gt; true)\n\n  # Generates a date select that when POSTed is stored in the post variable, in the written_on attribute\n  # with the fields ordered as day, month, year rather than month, day, year.\n  date_select(&quot;post&quot;, &quot;written_on&quot;, :order =&gt; [:day, :month, :year])\n\n  # Generates a date select that when POSTed is stored in the user variable, in the birthday attribute\n  # lacking a year field.\n  date_select(&quot;user&quot;, &quot;birthday&quot;, :order =&gt; [:month, :day])\n\n  # Generates a date select that when POSTed is stored in the user variable, in the birthday attribute\n  # which is initially set to the date 3 days from the current date\n  date_select(&quot;post&quot;, &quot;written_on&quot;, :default =&gt; 3.days.from_now)\n\n  # Generates a date select that when POSTed is stored in the credit_card variable, in the bill_due attribute\n  # that will have a default day of 20.\n  date_select(&quot;credit_card&quot;, &quot;bill_due&quot;, :default =&gt; { :day =&gt; 20 })\n"
- !ruby/struct:SM::Flow::P 
  body: The selects are prepared for multi-parameter assignment to an Active Record object.
- !ruby/struct:SM::Flow::P 
  body: "Note: If the day is not included as an option but the month is, the day will be set to the 1st to ensure that all month choices are valid."
full_name: ActionView::Helpers::DateHelper#date_select
is_singleton: false
name: date_select
params: (object_name, method, options = {}, html_options = {})
visibility: public
