select_second(datetime, options = {}) public

Returns a select tag with options for each of the seconds 0 through 59 with the current second selected. The second can also be substituted for a second number. Override the field name using the :field_name option, ‘second’ by default.

Examples

  my_time = Time.now + 16.minutes

  # Generates a select field for seconds that defaults to the seconds for the time in my_time
  select_second(my_time)

  # Generates a select field for seconds that defaults to the number given
  select_second(33)

  # Generates a select field for seconds that defaults to the seconds for the time in my_time
  # that is named 'interval' rather than 'second'
  select_second(my_time, :field_name => 'interval')
Show source
Register or log in to add new notes.