Displaying 2 results from an estimated 2 matches for "sort_by_cuisin".
Did you mean:
sort_by_cuisine
2006 Jul 09
1
Quick Question
I have this method in a controller
def sort_by_cuisine
#@restaurants = Restaurant.find(:all, :conditions => ["cuisine_id =
:id", params], :order => params[:sort])
@cuisines = Cuisine.find_all
end
And I want to put the bulk of it in the model, but still call it from
the controller. How can I do this? I''m fairly n...
2006 Jul 31
9
Multiple Pagination
...rants,
:order => (params[
:sort ] || "name"),
:per_page => 2
@cuisines = Cuisine.find_all
rescue
redirect_to :action => :index
end
end
# sort by cuisine
def sort_by_cuisine
begin
@restaurant_pages, @restaurants = paginate :restaurants,
:conditions => [
"cuisine_id = :id", params ],
:order => (params[
:sort ] || "name"),...