Displaying 1 result from an estimated 1 matches for "sorthash".
Did you mean:
sort_hash
2005 Dec 31
3
Semi-Dynamic table sorting (without AJAX)
..., :sort=>''column1'' %>
<th><%= link_to ''Column2'', :sort=>''column2'' %>
</tr>
.....
</table>
...
your ''model'' controller ''list'' action should look like this....
def list
sorthash = {"column1"=>"column1, updated_at", "column2"=>"column2
DESC"}
sorthash.default = "column1, updated_at"
sort = params[:sort] || session[:model][:sort]
session[:model][:sort]=sort
@model_pages, @models = paginate :model, :per_...