Dear I used to use the will_paginate plugin, and now it is no longer available in the repository. I am using the one in the gem #gem install will_paginate in my controller I have this @careers = Career.paginate :page => params[:page], :per_page => 10 and in the view <%= will_paginate @careers %> I found this way in all the tutorials and the railscasts episode 51. Though I still receive the error undefined method paginate I have googled it but I did not get the answer any idea??? thanks --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Have you got at the bottom of your environment.rb file the line: require ''will_paginate'' I think this is needed because you''re using the gem version, when I believe the screencast is for the old plugin version (I''ll have to double check that, but its sounds like thats the case). Regards Kieran On Sun, Jun 22, 2008 at 3:32 AM, Shuaib85 <shuaib.zahda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Dear > > I used to use the will_paginate plugin, and now it is no longer > available in the repository. > > I am using the one in the gem > #gem install will_paginate > > in my controller I have this > > @careers = Career.paginate :page => params[:page], :per_page => 10 > > and in the view > > <%= will_paginate @careers %> > > I found this way in all the tutorials and the railscasts episode 51. > Though I still receive the error undefined method paginate > > I have googled it but I did not get the answer > > any idea??? > > thanks--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Thanks for the reply I did add the require ''will_paginate'' and it is not working I receive this error undefined method `paginate'' for #<Class:0x2c18b24> RAILS_ROOT: D:/ubaida/depot_r Application Trace | Framework Trace | Full Trace c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/ base.rb:1667:in `method_missing'' app/controllers/admin_controller.rb:12:in `list'' As for the cast, yes it is the old plugin and it is not available as well. Any alternative On Jun 22, 4:03 am, "Kieran P" <kieran...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Have you got at the bottom of your environment.rb file the line: > > require ''will_paginate'' > > I think this is needed because you''re using the gem version, when I believe > the screencast is for the old plugin version (I''ll have to double check > that, but its sounds like thats the case). > > Regards > Kieran > > On Sun, Jun 22, 2008 at 3:32 AM, Shuaib85 <shuaib.za...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Dear > > > I used to use the will_paginate plugin, and now it is no longer > > available in the repository. > > > I am using the one in the gem > > #gem install will_paginate > > > in my controller I have this > > > @careers = Career.paginate :page => params[:page], :per_page => 10 > > > and in the view > > > <%= will_paginate @careers %> > > > I found this way in all the tutorials and the railscasts episode 51. > > Though I still receive the error undefined method paginate > > > I have googled it but I did not get the answer > > > any idea??? > > > thanks--~--~---------~--~----~------------~-------~--~----~ 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 also have troubles with will_paginate http://www.ruby-forum.com/topic/157207#new It seems will_paginate have a large bug -- 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 -~----------~----~----~----~------~----~------~--~---
What version of will_paginate are you using? Older versions are broken on 2.1 and you should install the latest version: sudo gem install mislav-will_paginate -s http://gems.github.com Then put require ‘will_paginate’ in an initializer or in environment.rb (you need to have added vendor/gems to load path already to do that). (check this post for more details http://giantrobots.thoughtbot.com/2008/6/19/gotchas-when-upgrading-to-rails-2-1) Best. Mike On Jun 22, 2008, at 8:31 AM, Shuaib85 wrote:> > Hi > > Thanks for the reply > I did add the require ''will_paginate'' and it is not working > > I receive this error > > undefined method `paginate'' for #<Class:0x2c18b24> > > RAILS_ROOT: D:/ubaida/depot_r > Application Trace | Framework Trace | Full Trace > > c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/ > base.rb:1667:in `method_missing'' > app/controllers/admin_controller.rb:12:in `list'' > > > As for the cast, yes it is the old plugin and it is not available as > well. > Any alternative > > On Jun 22, 4:03 am, "Kieran P" <kieran...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Have you got at the bottom of your environment.rb file the line: >> >> require ''will_paginate'' >> >> I think this is needed because you''re using the gem version, when I >> believe >> the screencast is for the old plugin version (I''ll have to double >> check >> that, but its sounds like thats the case). >> >> Regards >> Kieran >> >> On Sun, Jun 22, 2008 at 3:32 AM, Shuaib85 <shuaib.za...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> >>> Dear >> >>> I used to use the will_paginate plugin, and now it is no longer >>> available in the repository. >> >>> I am using the one in the gem >>> #gem install will_paginate >> >>> in my controller I have this >> >>> @careers = Career.paginate :page => params[:page], :per_page => 10 >> >>> and in the view >> >>> <%= will_paginate @careers %> >> >>> I found this way in all the tutorials and the railscasts episode 51. >>> Though I still receive the error undefined method paginate >> >>> I have googled it but I did not get the answer >> >>> any idea??? >> >>> thanks > >--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I have version 2.2.2 -- 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 -~----------~----~----~----~------~----~------~--~---
What version of rails? if you''re using 2.1 I believe you need to get will_paginate version 2.3. On Jun 22, 2008, at 10:13 AM, GA Gorter wrote:> > I have version 2.2.2 > > > -- > 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 have installed version 2.3 following the tutorial and I still face the same issue On Jun 22, 5:18 pm, Michael Breen <hard...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What version of rails? if you''re using 2.1 I believe you need to get > will_paginate version 2.3. > > On Jun 22, 2008, at 10:13 AM, GA Gorter wrote: > > > > > I have version 2.2.2 > > > -- > > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I have installed version 2.3 following the tutorial and I still face > the same issueI had exactly the same problem, but I resolved by putting "require will_paginate" on the _last_ line of the of the environment.rb. Before I had it in the beginning of the file, and I received the same error you did. Not sure why it has to be on the bottom of the file, maybe someone can explain. Cheers, Aaron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
No after installing and adding to environment.rb file still getting the same error... -- 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 -~----------~----~----~----~------~----~------~--~---
Shuaib85 I have been usisng will_paginate and it seems to work fine. In the railscast episode 51 I believe the code for the pagination was put in the model - moved from the controller. Have you tried this? Also I notice that on your previous post it said that your undifined method was in your list action on line 12. perhaps you could show more of your code and also paste your question on the will_paginate google group where the author of the code often helps. I am a newb so I don''t know if this will help Best of sucess. - Owen c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/ base.rb:1667:in `method_missing'' app/controllers/admin_controller.rb:12:in `list'' On Sep 16, 5:58 am, Andy PS <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> No after installing and adding to environment.rb file still getting the > same error... > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I found an easy solution to this problem... Stop the WEbrick server and start it again... Seems dumb I know, but I was using the method where you modify config/ environment.rb to include this line: <code> config.gem ''mislav-will_paginate'', :version => ''~> 2.3.4'', :lib => ''will_paginate'', :source => ''http://gems.github.com''</ code> it should go right after the: <code>Rails::Initializer.run do |config| </code> line then you perform <code>sudo rake gems:install</code> and it installs the gem for you. But it was giving me this error message unti I stopped the WEbrick server and started it again. Go Figure... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Kleber Shimabuku
2009-Nov-01 23:34 UTC
Re: will_paginate generates undefined method paginate
Aaron Feng wrote:>> I have installed version 2.3 following the tutorial and I still face >> the same issue > > I had exactly the same problem, but I resolved by putting "require > will_paginate" on the _last_ line of the of the environment.rb. Before > I > had it in the beginning of the file, and I received the same error you > did. > Not sure why it has to be on the bottom of the file, maybe someone can > explain. > > Cheers, > > AaronWoW! Don''t know why, but it works here too on mislav-will_paginate (2.3.11) Thank you! -- Posted via http://www.ruby-forum.com/.
Khaschuluu Munkhbayar
2010-Sep-08 23:20 UTC
Re: will_paginate generates undefined method paginate
hqmq wrote:> I found an easy solution to this problem... > Stop the WEbrick server and start it again...Yeah I fix it :D 10x -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Without your answer, I would probably have witch-hunted forever... Thanks hqmq wrote in post #731654:> I found an easy solution to this problem... > Stop the WEbrick server and start it again... > > Seems dumb I know, but I was using the method where you modify config/ > environment.rb to include this line: > <code> config.gem ''mislav-will_paginate'', :version => ''~> > 2.3.4'', :lib => ''will_paginate'', :source => ''http://gems.github.com''</ > code> > it should go right after the: <code>Rails::Initializer.run do |config| > </code> line > > then you perform <code>sudo rake gems:install</code> and it installs > the gem for you. But it was giving me this error message unti I > stopped the WEbrick server and started it again. > > Go Figure...-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
you can replace .paginate by .send(:paginate) to cheat it ... -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.