Flowdock
method

weekday_options_for_select

Importance_1
v7.1.3.2 - Show latest stable - 0 notes - Class: ActionView::Helpers::FormOptionsHelper
  • 1.0.0
  • 1.1.6
  • 1.2.6
  • 2.0.3
  • 2.1.0
  • 2.2.1
  • 2.3.8
  • 3.0.0
  • 3.0.9
  • 3.1.0
  • 3.2.1
  • 3.2.8
  • 3.2.13
  • 4.0.2
  • 4.1.8
  • 4.2.1
  • 4.2.7
  • 4.2.9
  • 5.0.0.1
  • 5.1.7
  • 5.2.3
  • 6.0.0
  • 6.1.3.1
  • 6.1.7.7
  • 7.0.0 (0)
  • 7.1.3.2 (38)
  • What's this?
weekday_options_for_select(selected = nil, index_as_value: false, day_format: :day_names, beginning_of_week: Date.beginning_of_week) public

Returns a string of option tags for the days of the week.

Options:

  • :index_as_value - Defaults to false, set to true to use the indexes from I18n.translate("date.day_names") as the values. By default, Sunday is always 0.

  • :day_format - The I18n key of the array to use for the weekday options. Defaults to :day_names, set to :abbr_day_names for abbreviations.

  • :beginning_of_week - Defaults to Date.beginning_of_week.

NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.

Show source
Register or log in to add new notes.