An open API service indexing awesome lists of open source software.

https://github.com/smortex/twitter_bootstrap_combo

Advanced combo-box using Twitter-Bootstrap
https://github.com/smortex/twitter_bootstrap_combo

hacktoberfest

Last synced: 4 months ago
JSON representation

Advanced combo-box using Twitter-Bootstrap

Awesome Lists containing this project

README

          

# TwitterBootstrapCombo

Advanced combo-box using Twitter-Bootstrap

## Installation

Add this line to your application's Gemfile:

gem 'twitter_bootstrap_combo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install twitter_bootstrap_combo

## Usage

Add this line to `app/assets/javascripts/application.js`:

~~~js
//= twitter_bootstrap_combo
~~~

Then in your views, use:

~~~erb
<%= combo_box(:calendar, :parent_id, Calendar.all.collect { |c| [ (content_tag(:i, "", :class => "fa fa-angle-right fa-fw") * c.level + c.name).html_safe, c.id ] }, :include_blank => true) %>
~~~

to produce:

~~~html


~~~

which render like this:

![combo-closed](http://img11.hostingpics.net/pics/892421comboboxclosed.png)

![combo-opened](http://img11.hostingpics.net/pics/781716comboboxopened.png)

## 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