Module: LotusAdmin::FormHelpers
- Defined in:
- app/helpers/lotus_admin/form_helpers.rb
Instance Method Summary collapse
- #material_form_button(label) ⇒ Object
- #material_form_cancel(path) ⇒ Object
- #material_form_for(resource, options = {}, &block) ⇒ Object
- #material_form_submit(resource) ⇒ Object
Instance Method Details
#material_form_button(label) ⇒ Object
24 25 26 27 28 |
# File 'app/helpers/lotus_admin/form_helpers.rb', line 24 def (label) class: 'btn btn-success' do label.html_safe + content_tag(:i, nil, class: 'zmdi zmdi-arrow-forward') end end |
#material_form_cancel(path) ⇒ Object
20 21 22 |
# File 'app/helpers/lotus_admin/form_helpers.rb', line 20 def material_form_cancel(path) link_to 'Cancel', path, class: 'btn btn-link' end |
#material_form_for(resource, options = {}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/helpers/lotus_admin/form_helpers.rb', line 3 def material_form_for(resource, = {}, &block) [:builder] ||= LotusAdmin::FormBuilder [:wrapper] = :material_form [:wrapper_mappings] = { boolean: :material_boolean_horizontal } simple_form_for(resource, , &block) end |
#material_form_submit(resource) ⇒ Object
13 14 15 16 17 18 |
# File 'app/helpers/lotus_admin/form_helpers.rb', line 13 def material_form_submit(resource) label = "Create #{ resource.class.model_name.human }" label = "Save Changes" if resource.persisted? (label) end |