[Rails] Confused by the different syntax
by Marlon Moyer other posts by this author
Sep 9 2005 8:21AM messages near this date
[Rails] using rails in a business
|
Re: [Rails] Confused by the different syntax
I was reworking the 4 days on rails tutorial since I saw an easy way
to use related tables in the find method. So I started to rework the
paginator code and got confused by the different syntax.
This is my code that I was trying fix:
def list_by_category
@item_pages = Paginator.new self, Item.count, 10, @params['page']
** @items = Item.find(:all, :include=> :category, :order=>'category')
render_action 'list'
end
This is what the wiki states about using the paginator:
def list
@person_pages = Paginator.new self, Person.count, 10, @params['page']
** @people = Person.find_all nil, 'last_name, first_name',
@person_pages.current.to_sql
end
my question is about the starred line. Is the second form the older
version? Most of the examples I see have named arguments. I think
the first two arguments are conditions and order_by, but what would be
the third argument in the second form.
Thanks
--
Marlon
"Now watch what you say or they'll be calling you a radical,
liberal, fanatical, criminal. "
_______________________________________________
Rails mailing list
Rails@[...].org
http://lists.rubyonrails.org/mailman/listinfo/rails
Thread:
Marlon Moyer
Scott Barron
Joe Van Dyk
|