Module: ActiveForm::Mixins::AttributeMethods
- Defined in:
- lib/active_form/mixins/attribute_methods.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 |
# File 'lib/active_form/mixins/attribute_methods.rb', line 3 def self.included(base) [:type].each { |m| base.send(:undef_method, m) rescue nil } base.send(:extend, ClassMethods) end |
Instance Method Details
#attribute_names ⇒ Object
16 17 18 |
# File 'lib/active_form/mixins/attribute_methods.rb', line 16 def attribute_names [:style, :javascript, :title, :lang] + self.class.element_attribute_names.to_a end |
#attributes ⇒ Object
8 9 10 |
# File 'lib/active_form/mixins/attribute_methods.rb', line 8 def attributes @attributes ||= HashWithIndifferentAccess.new end |
#default_attributes ⇒ Object
12 13 14 |
# File 'lib/active_form/mixins/attribute_methods.rb', line 12 def default_attributes { :id => identifier, :class => css } end |