Hi to all!! I am new to ruby. I am trying to write a program to fetch the data from Database and written the data using pagination. I could get the data from DB. but pagination is not working. When i see the log file it is showing the following error. NoMethodError: undefined method ''paginatior'' #<Hash...> my pginate.rb and pagination.rb files are not in the same folder Here is my piece of code: def sample_method sql = "select * from customers where rownum < 100" collection = Sample::Models::Sa::Customer.find_by_sql(sql) options={:per_page => 10 , Page => 1} @pages, @customers = paginate_collection(collection,options) end Can any one point me where i am doing the mistake. Hope any one can help asap. Thanks & Regards joshi. -- 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 -~----------~----~----~----~------~----~------~--~---
On 15 Oct 2007, at 14:44, Vijaya Th wrote:> > Hi to all!! > > > I am new to ruby. I am trying to write a program to fetch the data > from > Database and written the data using pagination. I could get the data > from DB. but pagination is not working. When i see the log file it is > showing the following error. > > NoMethodError: undefined method ''paginatior'' #<Hash...>Sounds like that should be paginator> > collection = Sample::Models::Sa::Customer.find_by_sql(sql) > options={:per_page => 10 , Page => 1} >that probably wants to be :page Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:>> NoMethodError: undefined method ''paginatior'' #<Hash...> > Sounds like that should be paginator >> >> collection = Sample::Models::Sa::Customer.find_by_sql(sql) >> options={:per_page => 10 , Page => 1} >> > that probably wants to be :page > > FredIt is just a typo mistake :( Actual line is like this options= {:per_page =>10 , :page => 1} Thanks for the reply -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:>> NoMethodError: undefined method ''paginatior'' #<Hash...> > Sounds like that should be paginator >> >> collection = Sample::Models::Sa::Customer.find_by_sql(sql) >> options={:per_page => 10 , Page => 1} >> > that probably wants to be :page > > FredIt is just a typo mistake :( Actual line is like this options= {:per_page =>10 , :page => 1} Thanks for the reply the same function paginate_collection is working for another function. Don''t know where i am doing wrong. Any help in this matter is highly appreciated. Regards, joshi -- 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 -~----------~----~----~----~------~----~------~--~---