Skip to content
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.

Manually

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

Generator

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.

Notes

position fields are not shown in the tables and forms by default when a model is orderable

Clone this wiki locally