0.0
No commit activity in last 3 years
No release in over 3 years
Helper methods for generating Twitter Bootstrap markup
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

>= 1.0.5
~> 4.0
 Project Readme

BootstrapHelp

Bootstrap Help is a collection of Rails Helper methods that help build Bootstrap's HTML components.

Installation

Add this line to your application's Gemfile:

gem 'bootstrap_help'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bootstrap_help

Usage

Nav Helper

The Nav Helper helps you quickly build a fixed navigation bar in Bootstrap. For example:

= main_nav(brand: "My Awesome Company") do
  = left do
    = dropdown_menu "My Menu" do
      = menu_link_to "Link1", "#"
      = menu_link_to "Link2", "#"
      = menu_link_to "Link3", "#"
      = dropdown_divider
      = menu_link_to "Link4", "#"
  = right do
      = menu_link_to "Sign In", "#"

Table Helper

The Table Helper helps you quickly build Bootstrap tables with collections of instances. For example:

= table_for(@apples, row_decorators: { error: :has_worm?) do
  = column "Hex Color" do |apple|
    - apple.color.to_hex
  = column 'Type of Apple', :type

Button Helper

The button helper renders buttons with the proper Bootstrap markup. You can optionally add icons from the Bootstrap library that are listed here

= primary_button_to "New Store", new_store_path
= primary_button_to "Edit Store", edit_store_path(@store), icon: "edit"
= button_toolbar do
  = button "zoom-in", store
  = button "edit", edit_store_path(@store)
  = button "remove-sign", store, method: :delete

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request