Hi there, I have managed to overcome my search issue, and now I am able to return users successfully. I am now trying to paginate the results, so only 10 are displayed on each page. The paginate example in the RailsSpace book doesn’t work in my version of rails (2.3.3). So – my question is: Has anyone had this issue, and if so how was it overcome? Or Is there a simpler way to implement this to tidy the results up Many Thanks I''m not too hot with Ruby on Rails yet, so if anyone can help, in a simple explanation kinda way, that would be cool! :-)
is this the answer im looking for perhaps? http://api.rubyonrails.org/classes/ActionController/Pagination.html On 28 Oct, 13:56, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi there, > > I have managed to overcome my search issue, and now I am able to > return users successfully. > > I am now trying to paginate the results, so only 10 are displayed on > each page. > > The paginate example in the RailsSpace book doesn’t work in my version > of rails (2.3.3). So – my question is: > > Has anyone had this issue, and if so how was it overcome? > > Or > > Is there a simpler way to implement this to tidy the results up > > Many Thanks > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > simple explanation kinda way, that would be cool! :-)
On Oct 28, 1:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi there, > > I have managed to overcome my search issue, and now I am able to > return users successfully. > > I am now trying to paginate the results, so only 10 are displayed on > each page. > > The paginate example in the RailsSpace book doesn’t work in my version > of rails (2.3.3). So – my question is: > > Has anyone had this issue, and if so how was it overcome?pagination was removed from rails in 2.0. Get the will_paginate plugin. Fred> > Or > > Is there a simpler way to implement this to tidy the results up > > Many Thanks > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > simple explanation kinda way, that would be cool! :-)
Sorry, Has anyone managed to get the willl_paginate plugin to work? The git hub site makes no sense, and the example isn''t clear enough for me to know what im meant to be doing...... ie: What exactly do I need to put in the user.rb file in models What goes in the controller and what goes in the view? I am new to this and understand sometings, but this isn''t too clear for a beginner.... cheers On 28 Oct, 15:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Oct 28, 1:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > > Hi there, > > > I have managed to overcome my search issue, and now I am able to > > return users successfully. > > > I am now trying to paginate the results, so only 10 are displayed on > > each page. > > > The paginate example in the RailsSpace book doesn’t work in my version > > of rails (2.3.3). So – my question is: > > > Has anyone had this issue, and if so how was it overcome? > > pagination was removed from rails in 2.0. Get the will_paginate > plugin. > > Fred > > > > > > > Or > > > Is there a simpler way to implement this to tidy the results up > > > Many Thanks > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > simple explanation kinda way, that would be cool! :-)
You should not need to add anything to your models, unless you want to change the default number of fetched results per model. In your controller, instead of doing @things = Thing.find(:all, :conditions => whatever) you can do this @things = Thing.paginate(:page => params[:page], :conditions => whatever) In your view you add <%= will_paginate @things %> And it automatically adds the pagination links. If you look at the HTML output in a browser, you should see the tags and classes used, so that you can style them. It may get slightly more complicated if you''re including search strings, sorting or other conditions, but so long as you can get your params to the controller and into a :condition, it should play nice. On Oct 28, 10:55 am, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Sorry, > > Has anyone managed to get the willl_paginate plugin to work? > > The git hub site makes no sense, and the example isn''t clear enough > for me to know what im meant to be doing...... > > ie: What exactly do I need to put in the user.rb file in models > What goes in the controller > and what goes in the view? > > I am new to this and understand sometings, but this isn''t too clear > for a beginner.... > > cheers > > On 28 Oct, 15:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Oct 28, 1:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > > Hi there, > > > > I have managed to overcome my search issue, and now I am able to > > > return users successfully. > > > > I am now trying to paginate the results, so only 10 are displayed on > > > each page. > > > > The paginate example in the RailsSpace book doesn’t work in my version > > > of rails (2.3.3). So – my question is: > > > > Has anyone had this issue, and if so how was it overcome? > > > pagination was removed from rails in 2.0. Get the will_paginate > > plugin. > > > Fred > > > > Or > > > > Is there a simpler way to implement this to tidy the results up > > > > Many Thanks > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > simple explanation kinda way, that would be cool! :-)
Hmmm... I must be missing something.. here''s what I have so far: def search @title = "Search" if params[:q] query = params[:q] # First find the user hits... @users = User.find_with_ferret(query, :limit => :all) # ...then the subhits. infos = Info.find_with_ferret(query, :limit => :all) # Now combine into one list of distinct users sorted by last name. hits = infos @users.concat(hits.collect { |hit| hit.user }).uniq! # Sort by last name (requires a spec for each user). @users.each { |user| user.info ||= Info.new } @users = @users.sort_by { |user| user.info.last_name } end At the moment, this returns results, but has no pagination I''m not 100% what i''m meant to add and where, to allow it to paginate properly On 28 Oct, 18:14, sax <s...-c5KP9hz/kbxwMgcQ4+lbG0B+6BGkLq7r@public.gmane.org> wrote:> You should not need to add anything to your models, unless you want to > change the default number of fetched results per model. > > In your controller, instead of doing > > @things = Thing.find(:all, :conditions => whatever) > > you can do this > > @things = Thing.paginate(:page => params[:page], :conditions => > whatever) > > In your view you add > > <%= will_paginate @things %> > > And it automatically adds the pagination links. If you look at the > HTML output in a browser, you should see the tags and classes used, so > that you can style them. > > It may get slightly more complicated if you''re including search > strings, sorting or other conditions, but so long as you can get your > params to the controller and into a :condition, it should play nice. > > On Oct 28, 10:55 am, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > > > > Sorry, > > > Has anyone managed to get the willl_paginate plugin to work? > > > The git hub site makes no sense, and the example isn''t clear enough > > for me to know what im meant to be doing...... > > > ie: What exactly do I need to put in the user.rb file in models > > What goes in the controller > > and what goes in the view? > > > I am new to this and understand sometings, but this isn''t too clear > > for a beginner.... > > > cheers > > > On 28 Oct, 15:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On Oct 28, 1:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > > wrote: > > > > > Hi there, > > > > > I have managed to overcome my search issue, and now I am able to > > > > return users successfully. > > > > > I am now trying to paginate the results, so only 10 are displayed on > > > > each page. > > > > > The paginate example in the RailsSpace book doesn’t work in my version > > > > of rails (2.3.3). So – my question is: > > > > > Has anyone had this issue, and if so how was it overcome? > > > > pagination was removed from rails in 2.0. Get the will_paginate > > > plugin. > > > > Fred > > > > > Or > > > > > Is there a simpler way to implement this to tidy the results up > > > > > Many Thanks > > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > > simple explanation kinda way, that would be cool! :-)
Ah. The documentation is assuming an ActiveRecord find, not acts_as_ferret google is your friend? http://www.google.com/search?client=safari&rls=en&q=acts_as_ferret+pagination&ie=UTF-8&oe=UTF-8 On Oct 28, 11:35 am, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hmmm... I must be missing something.. > > here''s what I have so far: > > def search > > @title = "Search" > if params[:q] > query = params[:q] > # First find the user hits... > @users = User.find_with_ferret(query, :limit => :all) > # ...then the subhits. > infos = Info.find_with_ferret(query, :limit => :all) > > # Now combine into one list of distinct users sorted by last > name. > hits = infos > @users.concat(hits.collect { |hit| hit.user }).uniq! > # Sort by last name (requires a spec for each user). > @users.each { |user| user.info ||= Info.new } > @users = @users.sort_by { |user| user.info.last_name } > > end > > At the moment, this returns results, but has no pagination > > I''m not 100% what i''m meant to add and where, to allow it to paginate > properly > > On 28 Oct, 18:14, sax <s...-c5KP9hz/kbxwMgcQ4+lbG0B+6BGkLq7r@public.gmane.org> wrote: > > > > > You should not need to add anything to your models, unless you want to > > change the default number of fetched results per model. > > > In your controller, instead of doing > > > @things = Thing.find(:all, :conditions => whatever) > > > you can do this > > > @things = Thing.paginate(:page => params[:page], :conditions => > > whatever) > > > In your view you add > > > <%= will_paginate @things %> > > > And it automatically adds the pagination links. If you look at the > > HTML output in a browser, you should see the tags and classes used, so > > that you can style them. > > > It may get slightly more complicated if you''re including search > > strings, sorting or other conditions, but so long as you can get your > > params to the controller and into a :condition, it should play nice. > > > On Oct 28, 10:55 am, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > > Sorry, > > > > Has anyone managed to get the willl_paginate plugin to work? > > > > The git hub site makes no sense, and the example isn''t clear enough > > > for me to know what im meant to be doing...... > > > > ie: What exactly do I need to put in the user.rb file in models > > > What goes in the controller > > > and what goes in the view? > > > > I am new to this and understand sometings, but this isn''t too clear > > > for a beginner.... > > > > cheers > > > > On 28 Oct, 15:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Oct 28, 1:56 pm, RubyonRails_newbie <craigwest...@googlemail.com> > > > > wrote: > > > > > > Hi there, > > > > > > I have managed to overcome my search issue, and now I am able to > > > > > return users successfully. > > > > > > I am now trying to paginate the results, so only 10 are displayed on > > > > > each page. > > > > > > The paginate example in the RailsSpace book doesn’t work in my version > > > > > of rails (2.3.3). So – my question is: > > > > > > Has anyone had this issue, and if so how was it overcome? > > > > > pagination was removed from rails in 2.0. Get the will_paginate > > > > plugin. > > > > > Fred > > > > > > Or > > > > > > Is there a simpler way to implement this to tidy the results up > > > > > > Many Thanks > > > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > > > simple explanation kinda way, that would be cool! :-)
hmmmm when I try and add: @users = User.paginate_by_contents(@search.query, :total_entries => User.total_hits(@search.query), :page => params [:page], :per_page => 10) I get this in the browser: You have a nil object when you didn''t expect it! The error occurred while evaluating nil.query Nothing seems to run through it step by step...... On 28 Oct, 20:07, sax <s...-c5KP9hz/kbxwMgcQ4+lbG0B+6BGkLq7r@public.gmane.org> wrote:> Ah. The documentation is assuming an ActiveRecord find, not > acts_as_ferret > > google is your friend? > > http://www.google.com/search?client=safari&rls=en&q=acts_as_ferret+pa... > > On Oct 28, 11:35 am, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > > > > Hmmm... I must be missing something.. > > > here''s what I have so far: > > > def search > > > @title = "Search" > > if params[:q] > > query = params[:q] > > # First find the user hits... > > @users = User.find_with_ferret(query, :limit => :all) > > # ...then the subhits. > > infos = Info.find_with_ferret(query, :limit => :all) > > > # Now combine into one list of distinct users sorted by last > > name. > > hits = infos > > @users.concat(hits.collect { |hit| hit.user }).uniq! > > # Sort by last name (requires a spec for each user). > > @users.each { |user| user.info ||= Info.new } > > @users = @users.sort_by { |user| user.info.last_name } > > > end > > > At the moment, this returns results, but has no pagination > > > I''m not 100% what i''m meant to add and where, to allow it to paginate > > properly > > > On 28 Oct, 18:14, sax <s...-c5KP9hz/kbxwMgcQ4+lbG0B+6BGkLq7r@public.gmane.org> wrote: > > > > You should not need to add anything to your models, unless you want to > > > change the default number of fetched results per model. > > > > In your controller, instead of doing > > > > @things = Thing.find(:all, :conditions => whatever) > > > > you can do this > > > > @things = Thing.paginate(:page => params[:page], :conditions => > > > whatever) > > > > In your view you add > > > > <%= will_paginate @things %> > > > > And it automatically adds the pagination links. If you look at the > > > HTML output in a browser, you should see the tags and classes used, so > > > that you can style them. > > > > It may get slightly more complicated if you''re including search > > > strings, sorting or other conditions, but so long as you can get your > > > params to the controller and into a :condition, it should play nice. > > > > On Oct 28, 10:55 am, RubyonRails_newbie <craigwest...-gM/Ye1E23myhRSP0FMvGiw@public.gmane.orgm> > > > wrote: > > > > > Sorry, > > > > > Has anyone managed to get the willl_paginate plugin to work? > > > > > The git hub site makes no sense, and the example isn''t clear enough > > > > for me to know what im meant to be doing...... > > > > > ie: What exactly do I need to put in the user.rb file in models > > > > What goes in the controller > > > > and what goes in the view? > > > > > I am new to this and understand sometings, but this isn''t too clear > > > > for a beginner.... > > > > > cheers > > > > > On 28 Oct, 15:04, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > On Oct 28, 1:56 pm, RubyonRails_newbie <craigwest...@googlemail.com> > > > > > wrote: > > > > > > > Hi there, > > > > > > > I have managed to overcome my search issue, and now I am able to > > > > > > return users successfully. > > > > > > > I am now trying to paginate the results, so only 10 are displayed on > > > > > > each page. > > > > > > > The paginate example in the RailsSpace book doesn’t work in my version > > > > > > of rails (2.3.3). So – my question is: > > > > > > > Has anyone had this issue, and if so how was it overcome? > > > > > > pagination was removed from rails in 2.0. Get the will_paginate > > > > > plugin. > > > > > > Fred > > > > > > > Or > > > > > > > Is there a simpler way to implement this to tidy the results up > > > > > > > Many Thanks > > > > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > > > > simple explanation kinda way, that would be cool! :-)
On Wed, Oct 28, 2009 at 6:56 AM, RubyonRails_newbie < craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Hi there, > > I have managed to overcome my search issue, and now I am able to > return users successfully. > > I am now trying to paginate the results, so only 10 are displayed on > each page. > > The paginate example in the RailsSpace book doesn’t work in my version > of rails (2.3.3). So – my question is: > > Has anyone had this issue, and if so how was it overcome? > > Or > > Is there a simpler way to implement this to tidy the results up > > Many Thanks > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > simple explanation kinda way, that would be cool! :-) >If you''re working your way through RailsSpace, then I would recommend reading this: http://railsspace.com/ Good luck, -Conrad> > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
that''s what I am reading, and the code in there hasn''t helped solve this issue! On 28 Oct, 21:53, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Wed, Oct 28, 2009 at 6:56 AM, RubyonRails_newbie < > > > > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > Hi there, > > > I have managed to overcome my search issue, and now I am able to > > return users successfully. > > > I am now trying to paginate the results, so only 10 are displayed on > > each page. > > > The paginate example in the RailsSpace book doesn’t work in my version > > of rails (2.3.3). So – my question is: > > > Has anyone had this issue, and if so how was it overcome? > > > Or > > > Is there a simpler way to implement this to tidy the results up > > > Many Thanks > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > simple explanation kinda way, that would be cool! :-) > > If you''re working your way through RailsSpace, then I would recommend > reading this: > > http://railsspace.com/ > > Good luck, > > -Conrad > > > >
I would suggest that you start a new app just to learn how to use pagination. RailsSpace is a good tutorial but there are several "version of..." issues embedded in the code. Pagination is one. 1) "gem install mislav-will_paginate" (or "sudo gem install mislav-will_paginate" if you must) NOTE: this is not the same gem as will_paginate. 2) Go to "http://github.com/mislav/will_paginate/blob/master/ README.rdoc" and keep this page up in your browser as you follow the instructions. 3) run "rails pagin" and create a throw-away app that will just do pagination. I would suggest that you just have one model - Word - and create a word index that paginates 10 words per page, then get fancy and sort the words. The simplest way to go is to have your words_controller.rb include: require ''will_paginate'' def index #@words = Word.all @words = Word.paginate :page => :params[:page], :per_page => 10 . . . And to have your index.html.erb include: <h1>Listing words</h1> <%= will_paginate @words %> . . . NOTE: there appears to be a bug related to the view pagination controls under Ruby 1.9 - all''s good with 1.8 however. On Oct 28, 5:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> that''s what I am reading, and the code in there hasn''t helped solve > this issue! > > On 28 Oct, 21:53, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Wed, Oct 28, 2009 at 6:56 AM, RubyonRails_newbie < > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > Hi there, > > > > I have managed to overcome my search issue, and now I am able to > > > return users successfully. > > > > I am now trying to paginate the results, so only 10 are displayed on > > > each page. > > > > The paginate example in the RailsSpace book doesn’t work in my version > > > of rails (2.3.3). So – my question is: > > > > Has anyone had this issue, and if so how was it overcome? > > > > Or > > > > Is there a simpler way to implement this to tidy the results up > > > > Many Thanks > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > simple explanation kinda way, that would be cool! :-) > > > If you''re working your way through RailsSpace, then I would recommend > > reading this: > > >http://railsspace.com/ > > > Good luck, > > > -Conrad
This is a great idea. I always make mini projects to learn new functionality and then move it to my main project when I''ve got it working right. On Fri, Oct 30, 2009 at 9:25 AM, Rick <richard.t.lloyd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I would suggest that you start a new app just to learn how to use > pagination. RailsSpace is a good tutorial but there are several > "version of..." issues embedded in the code. Pagination is one. > > 1) "gem install mislav-will_paginate" > (or "sudo gem install mislav-will_paginate" if you must) > > NOTE: this is not the same gem as will_paginate. > > 2) Go to "http://github.com/mislav/will_paginate/blob/master/ > README.rdoc" and keep this page up in your browser as you follow the > instructions. > > 3) run "rails pagin" and create a throw-away app that will just > do pagination. I would suggest that you just have one model - Word - > and create a word index that paginates 10 words per page, then get > fancy and sort the words. > > The simplest way to go is to have your words_controller.rb include: > > require ''will_paginate'' > > def index > #@words = Word.all > @words = Word.paginate :page => :params[:page], :per_page => 10 > . > . > . > > And to have your index.html.erb include: > > <h1>Listing words</h1> > <%= will_paginate @words %> > . > . > . > > NOTE: there appears to be a bug related to the view pagination > controls under Ruby 1.9 - all''s good with 1.8 however. > > On Oct 28, 5:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > that''s what I am reading, and the code in there hasn''t helped solve > > this issue! > > > > On 28 Oct, 21:53, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Wed, Oct 28, 2009 at 6:56 AM, RubyonRails_newbie < > > > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > > Hi there, > > > > > > I have managed to overcome my search issue, and now I am able to > > > > return users successfully. > > > > > > I am now trying to paginate the results, so only 10 are displayed on > > > > each page. > > > > > > The paginate example in the RailsSpace book doesn’t work in my > version > > > > of rails (2.3.3). So – my question is: > > > > > > Has anyone had this issue, and if so how was it overcome? > > > > > > Or > > > > > > Is there a simpler way to implement this to tidy the results up > > > > > > Many Thanks > > > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > > simple explanation kinda way, that would be cool! :-) > > > > > If you''re working your way through RailsSpace, then I would recommend > > > reading this: > > > > >http://railsspace.com/ > > > > > Good luck, > > > > > -Conrad > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
One change from my previous - I misspoke when I identified a problem with the view pagination controls under ruby 1.9. I''ve done some added checking an determined that the problem is actually related to Rails3. So, as long as you''re not out there on the bloody edge... :-) On Oct 30, 10:47 am, Jillian Galloway <jwa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is a great idea. > I always make mini projects to learn new functionality and then move it to > my main project when I''ve got it working right. > > On Fri, Oct 30, 2009 at 9:25 AM, Rick <richard.t.ll...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I would suggest that you start a new app just to learn how to use > > pagination. RailsSpace is a good tutorial but there are several > > "version of..." issues embedded in the code. Pagination is one. > > > 1) "gem install mislav-will_paginate" > > (or "sudo gem install mislav-will_paginate" if you must) > > > NOTE: this is not the same gem as will_paginate. > > > 2) Go to "http://github.com/mislav/will_paginate/blob/master/ > > README.rdoc" and keep this page up in your browser as you follow the > > instructions. > > > 3) run "rails pagin" and create a throw-away app that will just > > do pagination. I would suggest that you just have one model - Word - > > and create a word index that paginates 10 words per page, then get > > fancy and sort the words. > > > The simplest way to go is to have your words_controller.rb include: > > > require ''will_paginate'' > > > def index > > #@words = Word.all > > @words = Word.paginate :page => :params[:page], :per_page => 10 > > . > > . > > . > > > And to have your index.html.erb include: > > > <h1>Listing words</h1> > > <%= will_paginate @words %> > > . > > . > > . > > > NOTE: there appears to be a bug related to the view pagination > > controls under Ruby 1.9 - all''s good with 1.8 however. > > > On Oct 28, 5:56 pm, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > that''s what I am reading, and the code in there hasn''t helped solve > > > this issue! > > > > On 28 Oct, 21:53, Conrad Taylor <conra...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Wed, Oct 28, 2009 at 6:56 AM, RubyonRails_newbie < > > > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > > Hi there, > > > > > > I have managed to overcome my search issue, and now I am able to > > > > > return users successfully. > > > > > > I am now trying to paginate the results, so only 10 are displayed on > > > > > each page. > > > > > > The paginate example in the RailsSpace book doesn’t work in my > > version > > > > > of rails (2.3.3). So – my question is: > > > > > > Has anyone had this issue, and if so how was it overcome? > > > > > > Or > > > > > > Is there a simpler way to implement this to tidy the results up > > > > > > Many Thanks > > > > > > I''m not too hot with Ruby on Rails yet, so if anyone can help, in a > > > > > simple explanation kinda way, that would be cool! :-) > > > > > If you''re working your way through RailsSpace, then I would recommend > > > > reading this: > > > > >http://railsspace.com/ > > > > > Good luck, > > > > > -Conrad