instance method
select_second
Ruby on Rails 2.3.18
Since v2.2.3Signature
select_second(datetime, options = {}, html_options = {})
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') # Generates a select field for seconds with a custom prompt. Use :prompt=>true for a # generic prompt. select_minute(14, :prompt => 'Choose seconds')
Parameters
-
datetimereq -
optionsopt = {} -
html_optionsopt = {}
Source
# File actionpack/lib/action_view/helpers/date_helper.rb, line 425
def select_second(datetime, options = {}, html_options = {})
DateTimeSelector.new(datetime, options, html_options).select_second
end
Defined in actionpack/lib/action_view/helpers/date_helper.rb line 425
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::DateHelper