On 26 April 2011 09:41, amrit pal pathak <amritpalpath...@gmail.com> wrote: > > > On Apr 26, 4:30 am, amrit pal pathak <amritpalpath...@gmail.com> > wrote: >> Afer removing that block(from index.html.erb) ,i can see localhost: >> 3000/book ,but when i click on "New book" link it gave follwoing error >> >> NoMethodError in Book#new >> >> Showing /home/amrit/boook/app/views/book/_form.html.erb where line #1 >> raised: >> >> undefined method `model_name' for NilClass:Class > Should creation of model by "rails generate model book" > will resolve this error??
You already have a Book model so no point generating it again. You have had this error before, please read the error carefully. It says that something is nil that should not be. Earlier I suggested using ruby-debug to break into your code to see what is going on. What do you see if you break in at this point in the code? Colin -- 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.