-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Changelog
This page is a work-in-progress; if you feel like there is something that should be mentioned here, feel free to add it!
Extensions no longer seed by default. The proper workflow to create an extension is now:
# Add extension to your Gemfile
rails g refinery:<your_extension>
rake db:migrate
rake db:seed
Settings are now customized in the config/initializers/refinery
directory, not in the admin back-end.
All settings inside your Refinery application are now kept inside config/initializers/refinery
. They're copied there when you generate your extension.
Now as an installable extension located here.
Now, use:
rails generate refinery:engine <model_name> field:type field:type field:type
For more options, simple run:
rails generate refinery:engine
Settings are no longer referred to as RefinerySetting
, but as Refinery::<ExtensionNamespace>.value
. For example, inside an extension named Portfolio
, you might refer to Refinery::Portfolio.approximate_ascii_for_i18n
.
Internally, they are handled inside extensions in two separate files. First, default values are declared inside lib/refinery/<extension_name>/configuration.rb
Secondly, the file that is interpreted when generating the extension is kept inside lib/generators/refinery/<extension_name>/templates/config/initializers/<extension_name>.rb.erb
. You can see an example of the configuration file here, and you can see an example of the generator file here
Now Refinery::<Extension>::(Admin::)?(Model || Controller)
— for example, Refinery::Blog::Post
or Refinery::Blog::Admin::PostsController
.