Class: Alchemy::Forms::Builder
- Inherits:
-
SimpleForm::FormBuilder
- Object
- SimpleForm::FormBuilder
- Alchemy::Forms::Builder
- Defined in:
- lib/alchemy/forms/builder.rb
Instance Method Summary collapse
-
#input(attribute_name, options = {}, &block) ⇒ Object
Renders a simple_form input, but uses input alchemy_wrapper.
-
#submit(label, options = {}) ⇒ Object
Renders a button tag wrapped in a div with ‘submit’ class.
Instance Method Details
#input(attribute_name, options = {}, &block) ⇒ Object
Renders a simple_form input, but uses input alchemy_wrapper
6 7 8 9 |
# File 'lib/alchemy/forms/builder.rb', line 6 def input(attribute_name, = {}, &block) [:wrapper] = :alchemy super end |
#submit(label, options = {}) ⇒ Object
Renders a button tag wrapped in a div with ‘submit’ class.
13 14 15 16 17 18 |
# File 'lib/alchemy/forms/builder.rb', line 13 def submit(label, = {}) = {class: 'submit'}.update([:wrapper_html] || {}) template.content_tag('div', ) do template.content_tag('button', label, [:input_html]) end end |