Having different database sorting order (default_scope) for two different views
- by Juniper747
In my model (pins.rb), I have two sorting orders:
default_scope order: 'pins.featured DESC' #for adding featured posts to the top of a list
default_scope order: 'pins.created_at DESC' #for adding the remaining posts beneath the featured posts
This sorting order (above) is how I want my 'pins view' (index.html.erb) to look. Which is just a list…