Sha256: 7d757f179ff2cd9ce6a65f0e9dfc5a711b22f165cd520f81d99d4efedae0c2fb

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

= BootstrapFormBuilder

A Rails form builder that outputs forms structured for use with the
Twitter Bootstrap library. Labels are automatically created, and errors
are displayed inline.

BootstrapFormBuilder is built using syntax specific to Ruby 1.9. It
will not work on Ruby 1.8.

= Usage

The builder conforms generally to the generic Rails form builder API.

  <%= bootstrap_form_for @widget do |f| %>
    <%= f.text_field :name %>
    <%= f.collection_select :category_id, Category.all, :id, :name, include_blank: true %>
    <%= f.submit nil, class: 'primary' %>
  <% end %>

Labels are automatically created for the field. The label and the input
are wrapped inside of divs classed according to Twitter Bootstrap library's
conventions.

The field helpers also accept a block to which it yields the input or
select tag. This can be used to decorate the input fields.

  <%= f.text_field :price do |input_tag| %>
    <div class="input-append">
      <%= input_tag %>
      <label class="add-on">
        <%= f.check_box :taxable %>
        <span>Sales tax</span>
      </label>
    </div>
  <% end %>

= More information

http://twitter.github.com/bootstrap

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_form_builder-0.0.1 README.rdoc