AngularUI Bootstrap 3 for rails using hamlcoffee.Rails AngularUI Bootstrap - wraps
How it works.
I've tested this on Rails 4. Should also work with Rails 3.
Add rails_angularui_bootstrap to your rails Gemfile with
or live on the edge with
gem 'rails_angularui_bootstrap', github: 'cellis/rails-angularui-bootstrap'
- Install it:
- Make sure you have angularjs included in your
application.jsfile first. The angularjs-rails gem can do this for you.
- Include Bootstrap 3 in your css. You can use the anjlab/bootstrap-rails gem for this.
Include all the default angularui templates by adding:
//= require rails-angularui-bootstrap
@app = angular.module('app', [ 'ui.bootstrap' ])
How to customize the templates
There's a rake task for that. Run
rake angularui:generate to create all the haml templates in your app. You can then customize the markup as you see fit.
You can specify an angularui bootstrap fork and a branch with:
If you're using zsh like me, use:
Note: this task depends on NPM/grunt.
If you don't want to include every template, you can include each template individually with
//= require templates/rails-angularui-bootstrap/<name_of_template_1> //= require templates/rails-angularui-bootstrap/<name_of_template_2>
//= require rails-angularui-bootstrap/rails_angularui_bootstrap
For instance, to override the accordion, create:
See the original AngularUI Bootstrap files for examples.
How up to date is this project?
It uses the
ui-bootstrap-0.6.0-SNAPSHOT.js from @elerch's fork of angularui/bootstrap angular-ui/bootstrap:bootstrap3_bis2 because the collapse directive works in that. If you'd like to use the base repo you can do that using the generate task above.
Released under the terms of the MIT-LICENSE