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

Development

Runtime

>= 3.1
 Project Readme

TwitterBootstrapHelper¶ ↑

Refer to the rdoc documentation for this helper. I’m working on more examples.

This project rocks and uses MIT-LICENSE.

Navs¶ ↑

Navs require a bit of HTML to create. These helpers make it a little easier.

<%= tb_nav do %>
    <%= tb_nav_item(:dropdown => "Options", :html => {:id => "options-dropdown-button"}) do %>
        <%= tb_nav(:dropdown_menu, :html => {:id => "options-dropdown"}) do %>
            <%= tb_nav_item tb_link("Option 1", "#")) %>
            <%= tb_nav_item tb_link("Option 2", "#")) %>
            <%= tb_nav_item :divider %>
            <%= tb_nav_item tb_link(" Option 3", "#", :icon => "icon-ok")) %>
        <% end %>
    <% end %>
    <span class="btn-group pull-left">
      <%= tb_link("", "#", :icon => "icon-minus", :class => "btn", :id => "zoom-out-button") %>
      <%= tb_link("", "#", :icon => "icon-plus", :class => "btn", :id => "zoom-in-button") %>
    </span>
<% end %>

Modals¶ ↑

There are a couple of helpers to assist with creating and activating modals. One to create a button to activate a modal, and one to create the modal and the content itself.

The tb_modal_button helper takes the same options as tb_link

<%= tb_modal_button " Edit", "editModal", :class => "btn btn-success", :icon => "icon-edit" %>

For the actual modal, use tb_modal

<%= tb_modal "editModal", "Content of the modal", title: "Edit", ok_id: "submit-button", ok_label: "Save", ok_link: edit_object_path(@object), ok_class: "btn btn-success" %>

You can also use it as a block:

<%= tb_modal "editModal", title: "Edit", ok_id: "submit-button", ok_label: "Save", ok_link: edit_object_path(@object), ok_class: "btn btn-success" do %>
    Modal Content
<% end %>