dimanche 2 octobre 2016

undefined local variable or method 'book'

I am new to rails and trying to create a sample app. I have

App/routes.rb

Rails.application.routes.draw do 
     resources :books do
        book.resources :comments, :only => :create
     #root 'books#index'
end
end

No sure why i am getting error

/bookshelf/config/routes.rb:3:in `block (2 levels) in <top (required)>': undefined local variable or method `book' for #<ActionDispatch::Routing::Mapper:0x007fdebb03e728> (NameError)

Aucun commentaire:

Enregistrer un commentaire