Method: Padrino::Helpers::FormHelpers#week_field_tag

Defined in:
padrino-helpers/lib/padrino-helpers/form_helpers.rb

#week_field_tag(name, options = {}) ⇒ String

Constructs a week tag from the given options.

Examples:

week_field_tag('week_with_min_max', :min => DateTime.new(1993, 2, 24),
                                    :max => DateTime.new(2000, 4, 1))
week_field_tag('week_with_value', :value => DateTime.new(2000, 4, 1))

Parameters:

  • name (String)

    The name of the week field.

  • options (Hash) (defaults to: {})

    The html options for the week field.

Options Hash (options):

  • :min (DateTime, String)

    The min week time of the week field.

  • :max (DateTime, String)

    The max week time of the week field.

  • :value (DateTime, String)

    The value of the week field. See examples for details.

Returns:

  • (String)

    The html week field



748
749
750
751
752
# File 'padrino-helpers/lib/padrino-helpers/form_helpers.rb', line 748

def week_field_tag(name, options = {})
  options = { :name => name }.update(options)
  options = convert_attributes_into_datetime("%Y-W%W", options)
  input_tag(:week, options)
end