Skip to content

Instantly share code, notes, and snippets.

@kamilhism
Last active October 13, 2015 16:27
Show Gist options
  • Save kamilhism/4223149 to your computer and use it in GitHub Desktop.
Save kamilhism/4223149 to your computer and use it in GitHub Desktop.
Refinery new engine guide

How to create new engine in RefineryCMS

Create empty engine & migrate

rails g refinery:engine project title:string description:text
bundle install
rails generate refinery:projects
rake db:migrate
rake db:seed

(OPTIONAL) Override views of new engine

rake refinery:override view=refinery/projects/projects/*

can be found in views/refinery/projects/projects

(OPTIONAL) Add new field to new engine's model

rails g migration add_goal_field

in migration_file.rb:

add_column :refinery_projects, :goal, :text

don't forget to do rake db:migrate

Add new field in admin's views

rake refinery:override view=refinery/projects/admin/projects/*

after that you need to edit file _form.html.erb

Don't forget to edit model's attr_accessible

in modelname.rb:

rake refinery:override model=refinery/projects/project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment