I have a controller to sort by time…
def index
@shows = Show.all(:all, :order => ‘time’)
respond_to do |format|
format.html
format.xml { render :xml => @shows }
end
end
…which works fine when you view the ‘shows’ index.html.erb.
But I made a partial called _show_list.html.erb (which is ‘shows’
index.html.erb) but it doesn’t sort the listings by time.
But I made a partial called _show_list.html.erb (which is ‘shows’
index.html.erb) but it doesn’t sort the listings by time.
BTW the partial is located in a different ‘veiw’ as its supposed to.
Nevermind. I figured it out I just needed to add (:all, :order =>
‘time’) to the render.
Have a look at named_scope and default_scope. These may save you
sprinkling :order specs around the place.
Colin
2009/6/9 Aaron D. [email protected]: