Skip to content

Lesson: run the blacklight generator

flyingzumwalt edited this page Apr 4, 2013 · 9 revisions

This lesson is known to work with hydra-head version 6.0.0.rc4.
Please update this wiki to reflect any other versions that have been tested.

Goals

  • Run the code generator provided by the Blacklight gem

Explanation

Hydra is built on top of Blacklight, so it's important that we first run the Blacklight generator. This generates a number of files in your application that allow you to use and modify Blacklight's features in your application.

Steps

We do this by typing rails generate blacklight --devise. The --devise flag tells the generator to install the 'devise' gem, which takes care of authentication.

The blacklight generator has created a few database migrations that store users, saved searches and bookmarks. Additionally, it's installed the devise gem and the bootstrap gem. It's created an important file in our application app/controllers/catalog_controller.rb. This is the primary place where you configure the blacklight search.

At this point we should run the migrations, so that the database tables are built. To do this enter the following command: rake db:migrate

Next Step

Go on to Lesson: Start Jetty or return to the Dive into Hydra page.

Clone this wiki locally