Module: RailsBootstrapHelpers::Helpers::FormTagHelper
- Included in:
- ButtonHelper
- Defined in:
- lib/rails-bootstrap-helpers/helpers/form_tag_helper.rb
Instance Method Summary collapse
-
#bs_button_tag(value, type, options = {}, &block) ⇒ Object
Renders a Bootstrap button tag.
-
#bs_submit_tag(value, options = {}) ⇒ Object
Renders a Boolean submit tag.
Instance Method Details
#bs_button_tag(value, type, options = {}, &block) ⇒ Object
Renders a Bootstrap button tag. This method behaves just as button_tag but will render a Bootstrap styled button tag instead.
17 18 19 20 |
# File 'lib/rails-bootstrap-helpers/helpers/form_tag_helper.rb', line 17 def (value, type, = {}, &block) = .merge type: type RailsBootstrapHelpers::Renderers::ButtonRenderer.new(self, :button, value, , &block).render end |
#bs_submit_tag(value, options = {}) ⇒ Object
Renders a Boolean submit tag. This method behaves just as submit_tag but will render a Bootstrap styled submit tag instead.
All the other options are passed straight through to the underlying submit_tag method.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/rails-bootstrap-helpers/helpers/form_tag_helper.rb', line 33 def bs_submit_tag (value, = {}) = .dup if [:class].present? [:class] << " " else [:class] = "" end [:class] << "btn" if style = .delete(:style) [:class] << " btn-" + style.to_s end if size = .delete(:size) [:class] << " btn-" + size.to_s end submit_tag value, end |