Displaying 2 results from an estimated 2 matches for "model_pages".
Did you mean:
model_images
2006 Apr 06
3
scaffold question
...of the things in a scaffold available to just build by hand? for
instance, i have a scaffold for my users. in the list action, it has
@user_pages, so that you can put @user_pages.current.next or something
like that - is that something i can do with any of my model
automatically just by having @model_pages in the action?
--
Posted via http://www.ruby-forum.com/.
2005 Dec 31
3
Semi-Dynamic table sorting (without AJAX)
...uld 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_page => 10,
:order=>sorthash[sort]
end
=== What this does ===
The view passes a hash key as the :sort parameter. This gets looked up
in the sorthash, which returns the actual columns needed to sort. That
gets passed to the paginator.
Key features...
*...