I have a table in my app that currently displays items in the order in which they are created. I would like them to sort by my date attribute (<%= o.dateg %>) in chronological order. Whats the proper rails way to do this?
Controller:
def show
@occasion = Occasion.find(params[:id])
end
View:
<% @user.occasions.each do |o| %>
<td><%= o.name %></td>
<td><%= o.pname %></td>
<td><%= o.dateg %></td>
Thanks!
You must have that, right?
You can change the
has_manyto: