I have an app that manages images associated with buses. My problem is that I can't figure out how to sort an each block by a particular BusImage attribute, :thumb_order instead of the BusImage id.
A Bus has many BusImages.
The instance variables are defined in the Bus controller under Show as...
@bus = Bus.find(params[:id]
@bus_images = BusImage.find(:all, :order => 'thumb_order asc')
And I'm calling these instance variables in the Bus Show page like this:
@bus.bus_images.each do |bus_image|
bus_image.thumb_order
(other attributes, etc)
end
But no matter how I change the :order method on the @bus_images it doesn't affect the view at all. When I tried using the method on @bus, because Buses don't have thumb_order column, just stares at me blankly.