Module: RightRails::Helpers::Forms::InstanceTagMethods

Defined in:
lib/right_rails/helpers/forms.rb

Instance Method Summary collapse

Instance Method Details

#to_autocomplete_field_tag(options) ⇒ Object



325
326
327
# File 'lib/right_rails/helpers/forms.rb', line 325

def to_autocomplete_field_tag(options)
  to_input_field_tag('text', options)
end

#to_calendar_field_tag(options) ⇒ Object



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/right_rails/helpers/forms.rb', line 309

def to_calendar_field_tag(options)
  options = options.stringify_keys

  # formatting the date/time value if the format is specified
  calendar_options = (options["data-calendar-options"] || options["data-calendar"])
  if !options["value"] && calendar_options
    format = calendar_options.scan(/format:('|")(.+?)\1/)
    time = value_before_type_cast(object)
    if time && time.respond_to?(:to_time) && format.size == 1
      options["value"] = time.to_time.strftime(format[0][1])
    end
  end

  to_input_field_tag('text', options)
end

#to_colorpicker_field_tag(options) ⇒ Object



337
338
339
# File 'lib/right_rails/helpers/forms.rb', line 337

def to_colorpicker_field_tag(options)
  to_input_field_tag('text', options)
end

#to_rater_tag(options) ⇒ Object



333
334
335
# File 'lib/right_rails/helpers/forms.rb', line 333

def to_rater_tag(options)
  to_input_field_tag('hidden', options)
end

#to_rte_field_tag(options) ⇒ Object



345
346
347
# File 'lib/right_rails/helpers/forms.rb', line 345

def to_rte_field_tag(options)
  to_text_area_tag(options)
end

#to_slider_tag(options) ⇒ Object



329
330
331
# File 'lib/right_rails/helpers/forms.rb', line 329

def to_slider_tag(options)
  to_input_field_tag('hidden', options)
end

#to_tags_field_tag(options) ⇒ Object



341
342
343
# File 'lib/right_rails/helpers/forms.rb', line 341

def to_tags_field_tag(options)
  to_input_field_tag('text', options)
end