This is a tad different from rememebering say sort-by-date or sort-by-alphabet. I have a list of Items, that I’d like to allow the User to rearrange. More importantly, I’d like to remember that order. How would I do this?
This is a tad different from rememebering say sort-by-date or sort-by-alphabet. I have a
Share
Use the acts_as_list act. Put
acts_as_listin your model, add the field “position“, which is aninteger, to the table you want to sort, and create the new actions for the different sorts.The documentation for acts_as_list that I linked to has code examples, but if you need more help, leave a comment and I’ll edit this.