i am trying to call this in my controller
if(maincategory == ''sale'')
@pages, @viewobj = paginate_collection Sale.get_all_sales, :page =>
@params[:page]
end
if(maincategory == ''job'')
@pages, @viewobj = paginate_collection Job.get_all_jobs, :page =>
@params[:page]
end
etc...
but for some reason, when i click on the page link number, i get a nil
error. however, when i just put the
@pages, @viewobj = .... outside of the if statement, everything works
fine. i guess the maincategory field gets reset maybe?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
i am trying to call this in my controller
if(maincategory == ''sale'')
@pages, @viewobj = paginate_collection Sale.get_all_sales, :page =>
@params[:page]
end
if(maincategory == ''job'')
@pages, @viewobj = paginate_collection Job.get_all_jobs, :page =>
@params[:page]
end
etc...
but for some reason, when i click on the page link number, i get a nil
error. however, when i just put the
@pages, @viewobj = .... outside of the if statement, everything works
fine. i guess the maincategory field gets reset maybe?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
how can i split this statement into to individual parts? @pages, @viewobj = paginate_collection Job.get_all_jobs, :page => @params[:page] is that the same as @viewobj = paginate_collection(Job.get_all_jobs,:page => @params[:page]) @pages = paginate_collection(Job.get_all_jobs,:page => @params[:page]) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---