Class: RailsBootstrapForm::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_bootstrap_form/configuration.rb

Instance Method Summary collapse

Instance Method Details

#default_form_attributesObject



20
21
22
23
24
# File 'lib/rails_bootstrap_form/configuration.rb', line 20

def default_form_attributes
  return @default_form_attributes if defined?(@default_form_attributes)

  {}
end

#default_form_attributes=(attributes) ⇒ Object

Default HTML attributes which will applied to all forms build using RailsBootstrapForm.



9
10
11
12
13
14
15
16
17
18
# File 'lib/rails_bootstrap_form/configuration.rb', line 9

def default_form_attributes=(attributes)
  case attributes
  when nil
    @default_form_attributes = {}
  when Hash
    @default_form_attributes = attributes
  else
    raise ArgumentError, "Unsupported default_form_attributes #{attributes.inspect}"
  end
end