class ActionView::Helpers::InstanceTag

Public Instance Methods

to_enum_select_tag(options, html_options={}) click to toggle source
# File lib/enum/active_record_helper.rb, line 28
                    def to_enum_select_tag(options, html_options={})
                            if self.object.respond_to?(method_name.to_sym)
column = self.object.column_for_attribute(method_name)
                                    if (value = self.object.__send__(method_name.to_sym))
                                            options[:selected] ||= value.to_s
                                    else
  options[:include_blank] = column.null if options[:include_blank].nil?
                                    end
                            end
                            to_select_tag(column.limit, options, html_options)
                    end
to_tag_with_enumerated_attribute(options={}) click to toggle source
# File lib/enum/active_record_helper.rb, line 42
def to_tag_with_enumerated_attribute(options={})
        #look for an enum
        if (column_type == :enum && self.object.class.respond_to?(method_name.to_sym))
                to_enum_select_tag(options)
        else
                to_tag_without_enumerated_attribute(options)
        end
end