try params[:page] instead of parmas[:page] Also if you have an error post the trace here if we cant see the error ... we cant see the problem
On 2/09/2009, at 2:40 PM, fireflyman wrote: > > Hi,Dhruva > > Thank you for your help,but I still can't pass my test.May be the > code goes wrong . > > On Wed, Sep 2, 2009 at 10:23 AM, Dhruva Sagar > <dhruva.sa...@gmail.com> wrote: > The will_paginate's paginate method creates both the instance > variables and maintains them automatically. > All you will need to do is : > > @books = Book.paginage :page => parmas[:page], :per_page => > 10, :include => [:authors, :publishers], :order => :id > > You should check out railscasts.com episode 51, it demonstrates what > you wish to do quite well. > > Thanks & Regards, > Dhruva Sagar. > > > Ted Turner - "Sports is like a war without the killing." > > On Wed, Sep 2, 2009 at 7:48 AM, fireflyman <yangxiwenh...@gmail.com> > wrote: > > Hi,everybody > I write a code like follow,the question was "paginate" has been drop > until the rails 2.0,now we use > "will_paginate" to replace it.But I don't know how to change my code > to let it suitable. > ----------------------------------------------------------------------------------------------------- > def index > @page_title = "Book List" > @book_pages,@books = Book.paginate :books, > :per_page => 10, > :include => > [:authors, :publishers], > :order => "books.id > desc" > ------------------------------------------------------------------------------------------------- > So,I want may be somebody can help . > > > > > > > > > -- > Sons of Gondor, of Rohan, my brothers! > I see in your eyes the same fear that would take the heart of me. > A day may come when the courage of men fails when we forsake our > friends and break all bonds of fellowship. > But this is not this day. > And hour of wolves and shattered shields when the age of Men comes > crashing down. But this is not this day! > This day we fight! By all that you hold dear on this good earth, I > bid you stand! Men of the West! > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---