On Aug 18, 3:48 am, Venkat Eee <rails-mailing-l...@andreas-s.net>
wrote:
> Wap Addon wrote:
> > you have download wii_paginate and put vendor/plugin then
>
> > change environment.rb
> > put after end require 'will_paginate'
> > then in ur controller #...@images = Image.paginate :page => params[:page],
> > :per_page => 2 do some thing like this
>
> > and in ur index page <%= will_paginate @images%>
>
> > this is ur paging
>
> Hi Wap Addon,
>
> I am not using any plugins for pagination. I have written my own code
> for the pagination.
>
> So, how to increase the mysql performace? Can i use the index as below
> or any other way is there?
> ALTER TABLE customers ADD INDEX(customer_id);
> --
> Posted viahttp://www.ruby-forum.com/.

Is there an actual reason you're rolling your own code when
will_paginate handles this prettttty well already?

And of course you need the right indexes in place, but Customer.find
(:all) kindof defeats the whole purpose of pagination. A non worst-
possible solution for pagination involves using LIMIT and OFFSET in
your query. But I'm really curious as to why you're insistent on re-
inventing the wheel (honestly, fairly poorly) here.
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to