Stager

Stager is a Rails 3.1 gem to create scaffolds, controllers and models. The files created are specific to 45north's needs. This is a webdevelopment agency in Amsterdam, The Netherlands.

version 0.2.2
Robin Brouwer
45north

Installation

Stager only works with Rails 3.1. Add the following to your Gemfile:

gem 'stager'

Now just run bundle install and you're ready.

Scaffold generator

Usage:

# Use the User Model to create all actions.
rails g stager:scaffold User

# Use the User Model to create two actions.
rails g stager:scaffold User index show

# Use the User Model to create all actions, except one action.
rails g stager:scaffold User ! show

# Create a new User Model with all actions.
rails g stager:scaffold User name:string email:string

# Create a new User Model and three actions.
rails g stager:scaffold User name:string email:string index new create

Options:

--namespaced_model  # Create a namespaced Model.
--skip_migration    # Skip the migration file.
--skip_timestamps   # Skip the timestamps.
--skip_presenter    # Skip the presenter.
--skip_helper       # Skip the helper.
--skip_views        # Skip the views.

Controller generator

Usage:

# Create UsersController and use the User Model to create all actions.
rails g stager:controller Users

# Create UsersController and use the User Model to create two actions.
rails g stager:controller Users index show

# Create UsersController and use the User Model to create all actions, except one action.
rails g stager:controller Users ! show

# Create UsersController with all actions and use these two columns inside the views.
rails g stager:controller User name:string email:string

Options:

--namespaced_model  # The Model is namespaced inside the Controller.
--skip_helper       # Skip the helper.
--skip_views        # Skip the views.

Model generator

Usage:

# Create a new Model.
rails g stager:model User

# Create a new Model with columns.
rails g stager:model User name:string email:string

Options:

--skip_migration    # Skip the migration file.
--skip_timestamps   # Skip the timestamps.