Expansion
Expansion is intended to allow the dynamic addition of fields to a given model.
Installation
In your Gemfile
, add the following dependency:
gem 'expansion'
Run:
$ bundle install
Run the generator:
$ rails g expansion:install
And then run:
$ rake db:migrate
Usage
To your expandable
models, add the following function:
expandable
Your model will then have the following class function:
- expandable_attributes
And the following instance methods:
- expandable_attributes
- expandable_values