Rails helpers to build bootstrap components and avoid repeating html throughout your templates
Add this line to your application's Gemfile:
gem 'bootstrap_helpers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bootstrap_helpers
Only some components are supported for now.
Use the modal
helper method to build a modal.
All options passed to the helper that are not specific to it are passed
to the .modal-dialog
container div, like the :class
option.
Example :
= modal id: 'modal-form', fade: false do |m|
= m.header do
Modal
= form_for @resource do |f|
= m.body do
= f.text_field :field
= m.footer do
= f.submit
Use the panel
helper method to build a panel.
All options passed to the helper that are not specific to it are passed
to the .panel
container div, like the :class
option.
= panel do |p|
= p.header do
Panel
= p.body do
/ Contents here
= p.footer do
= link_to "Back", :back
Use the alert
helper method to build a alert.
All options passed to the helper that are not specific to it are passed
to the .alert
container div, like the :class
option.
= alert type: 'success', dismissable: false do |m|
Alert message
- Fork it ( https://github.com/glyph-fr/bootstrap_helpers/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request