Displaying 1 result from an estimated 1 matches for "paginate_all".
2007 Sep 02
17
A Proposal To Magically Remove ''params''
...ing advantage of this cool programming concept called ''arguments''.
An example
class ProductController
def show(id) # GET /products/show?id=12
@product = Product.find(id)
render
end
def index(page = 1) # GET /products?page=2
@products = Product.paginate_all(page)
render
end
end
Getting a parameter list for a method is rather difficult, but using
zenspider''s ParseTree, it is possible. (Attached is a proof of
concept. It is also viewable at http://pastie.caboo.se/93218 )
ParseTree is slow, but it only needs to be run once at load...