UCB Rails (Rails 4 Compatible, see master branch for Rails 3)

Get a jump start on your Rails project at UCB. Includes:

Installation

Add it to your Gemfile

gem 'ucb_rails'# 'bootstrap-view-helpers' needs to be added as well

gem 'bootstrap-view-helpers', github: 'ucb-ist-eas/bootstrap-view-helpers', branch: 'rails4'

From the command line, install the ucb_rails gem:

bundle install
rails g ucb_rails:install

Run installers for included gems:

rails generate user_announcements:install
rails generate simple_form:install --bootstrap

Run migrations:

rake db:migrate

Remove superseded files:

rm public/index.html

Add includes to application stylesheet

 *= require bootstrap-datepicker3

Add includes to application javascript

//= require bootstrap-datepicker

Restart your server and point your browser to:

http://<your_app>/ucb_rails

You'll be able to CalNet authenticate. Successful authentiation will redirect you to root_path. ucb_rails defines root_path but the definition in your host app (if any) will take precedence.

View Helper Methods

  • current_ldap_person
  • logged_in?

Upgrading From An Older Version

If you're upgrading from a version older than March 2015, you'll need to run an extra migration in the project that contains the ucb_rails gem. This will add an alternate_email column to your users table.

cp ucb_rails/dummy/db/migrate//20150318234744_add_alternate_email_to_users.rb [YOUR_PROJECT_ROOT]/db/migrate