Class: IceCubeSelectHelper::IceCubeSelectTag

Inherits:
ActionView::Helpers::Tags::Select
  • Object
show all
Includes:
FormOptionsHelper, SelectHTMLOptions
Defined in:
lib/helpers/ice_cube_select_helper.rb

Instance Method Summary collapse

Methods included from FormOptionsHelper

#recurring_options_for_select

Constructor Details

#initialize(object, method, template_object, default_schedules = nil, options = {}, html_options = {}) ⇒ IceCubeSelectTag

Returns a new instance of IceCubeSelectTag.



105
106
107
108
109
110
111
112
# File 'lib/helpers/ice_cube_select_helper.rb', line 105

def initialize(object, method, template_object, default_schedules = nil, options = {}, html_options = {})
  @default_schedules = default_schedules
  @template_object = template_object
  html_options = ice_cube_select_html_options(html_options)

  # Select expects: object_name, method_name, template_object, choices, options, html_options
  super(object, method, template_object, [], options, html_options)
end

Instance Method Details

#renderObject



114
115
116
117
# File 'lib/helpers/ice_cube_select_helper.rb', line 114

def render
  option_tags = add_options(recurring_options_for_select(value, @default_schedules, @options), @options, value)
  (option_tags, @options, @html_options)
end