Class: RecurringSelectHelper::RecurringSelectTag

Inherits:
ActionView::Helpers::Tags::Base
  • Object
show all
Includes:
FormOptionsHelper, SelectHTMLOptions
Defined in:
app/helpers/recurring_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 = {}) ⇒ RecurringSelectTag

Returns a new instance of RecurringSelectTag.


105
106
107
108
109
110
111
112
113
114
# File 'app/helpers/recurring_select_helper.rb', line 105

def initialize(object, method, template_object, default_schedules = nil, options = {}, html_options = {})
  @default_schedules = default_schedules
  @choices = @choices.to_a if @choices.is_a?(Range)
  @method_name = method.to_s
  @object_name = object.to_s
  @html_options = recurring_select_html_options(html_options)
  add_default_name_and_id(@html_options)

  super(object, method, template_object, options)
end

Instance Method Details

#renderObject


116
117
118
119
# File 'app/helpers/recurring_select_helper.rb', line 116

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