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
on 2008-06-21 17:33
on 2008-06-22 03:03
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 2008-06-22 14:31
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 2008-06-22 14:42
I also have troubles with will_paginate http://www.ruby-forum.com/topic/157207#new It seems will_paginate have a large bug
on 2008-06-22 16:08
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/gotcha...) Best. Mike
on 2008-06-22 16:20
What version of rails? if you're using 2.1 I believe you need to get will_paginate version 2.3.
on 2008-06-22 16:32
I have installed version 2.3 following the tutorial and I still face the same issue
on 2008-07-11 12:45
> 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, Aaron
on 2008-09-16 14:58
No after installing and adding to environment.rb file still getting the same error...
on 2008-09-16 16:16
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 2008-09-25 09:44
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...
on 2009-11-02 00:34
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, > > Aaron WoW! Don't know why, but it works here too on mislav-will_paginate (2.3.11) Thank you!
on 2010-09-09 01:20
hqmq wrote: > I found an easy solution to this problem... > Stop the WEbrick server and start it again... Yeah I fix it :D 10x
on 2011-08-28 16:48
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...
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.