Module: BootstrapFormHelper
- Defined in:
- app/helpers/bootstrap_form_helpers.rb
Overview
RAILS BOOTSTRAP ENGINE
Form Helpers for Bootstrap & Simple_Form
Copyright 2012-2013 Luiz Eduardo de Oliveira Fonseca, Agência Orangeweb
Licensed under The MIT License
Instance Method Summary collapse
-
#fieldset(title, &block) ⇒ Object
Generates a Fieldset.
-
#form_actions(form, back_url, submit_title = "Gravar", cancel_title = "Cancelar") ⇒ Object
Generates a form actions block with submit and cancel buttons.
-
#form_actions_block(&block) ⇒ Object
Generates a form actions block.
Instance Method Details
#fieldset(title, &block) ⇒ Object
Generates a Fieldset
23 24 25 26 27 28 |
# File 'app/helpers/bootstrap_form_helpers.rb', line 23 def fieldset title, &block #raw '<div class="form-inputs"><fieldset><legend>' + title + "</legend>" + # capture(&block) + # "</fieldset></div>" content_tag :fieldset, content_tag(:legend, title) << capture(&block) end |
#form_actions(form, back_url, submit_title = "Gravar", cancel_title = "Cancelar") ⇒ Object
Generates a form actions block with submit and cancel buttons
47 48 49 50 51 |
# File 'app/helpers/bootstrap_form_helpers.rb', line 47 def form_actions form, back_url, submit_title = "Gravar", cancel_title = "Cancelar" form_actions_block do (form. :submit, submit_title) + (link_to cancel_title, back_url) end end |
#form_actions_block(&block) ⇒ Object
Generates a form actions block
37 38 39 |
# File 'app/helpers/bootstrap_form_helpers.rb', line 37 def form_actions_block &block content_tag(:div, capture(&block), :class => "form-actions" ) end |