-
Notifications
You must be signed in to change notification settings - Fork 9
Ordering models
vala edited this page Dec 5, 2014
·
1 revision
Para allows you to order your models inside your components, or inside nested forms with ease.
You can either do it manually, or with a generator.
All you need is to :
- Add
acts_as_orderable
the desired model - Add a
t.integer :position, default: 0
column to its table - Run the migrations
You can run the following generator :
rails g para:orderable <your_model_name>
As with other generators, you can use the --migrate
or -m
option in the generator call to automatically run the migration.
position
fields are not shown in the tables and forms by default when a model is orderable