-
Notifications
You must be signed in to change notification settings - Fork 126
The Install Generator in Detail
To better understand Pageflow's configuration choices, you can run the
single steps of the install
generator one by one.
Let's look at the steps one at a time.
$ rails generate active_admin:devise User --no-default-user
Install devise and configure it to play nice with Active
Admin. Pageflow uses only a single User
model with a configurable
role. So we tell Active Admin not create its default AdminUser
model
but authenticate a User
instead.
$ rails generate active_admin:install --skip-users
This creates an initialzer for Active Admin and configures routing. Pageflow brings its own user admin component. So there's no need for the default user admin.
$ rails generate pageflow:active_admin_menu
This adapts the default active admin config to insert a user profile menu item next to sign out button.
$ rails generate friendly_id
Invoke the Friendly Id generator.
$ rails generate pageflow:resque
Create initializers to configure Resque under
config/initializers/resque_*
. Inside the initializers you find some
more explanations for the individual choices made.
$ rails generate pageflow:assets
Create javascript and stylesheet files. Those mostly contain a single
require
or import
and are the place to include further Pageflow
extensions.
$ rails generate pageflow:initializer
Create the Pageflow initializer which contains all configuration options. All available settings are described inside the file.
$ rails generate pageflow:routes
Inject the routes helper into config/routes.rb
. Pageflow runs at the
root url by default.
$ rails generate pageflow:cancan
Configure Active Admin to use the CanCan authorization adapter. And
create an Ability
class.
$ rails generate pageflow:user
Inject the Pageflow user mixin into the user class. As you can see
Pageflow works with User
and Ability
class that live in your
app. That way you can easily integrate new features into your app that
rely on Pageflow's user management.
$ rails generate seeds
Require Pageflow seed data in db/seeds.rb
.
$ rake pageflow:install:migrations
Finally the generator installs the database migrations which create tables for the Pageflow models.