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
- Host: GitHub
- URL: https://github.com/smortex/twitter_bootstrap_combo
- Owner: smortex
- License: mit
- Created: 2013-01-30T16:26:44.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T18:18:03.000Z (almost 2 years ago)
- Last Synced: 2025-12-05T23:56:25.347Z (6 months ago)
- Topics: hacktoberfest
- Language: Ruby
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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:


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