rails2.1 不认 new_books_path,books是一个controller
[code="java"]
Listing books
| Name | |||
|---|---|---|---|
| 'Are you sure?', :method => :delete %> |
<%= link_to 'New books', new_books_path %>[/code]
出错信息为:
NameError in Books#index
Showing books/index.html.erb where line #20 raised:
undefined local variable or method `new_books_path' for #ActionView::Base:0xb7371204
Extracted source (around line #20):
17:
18:
19:
20: <%= link_to 'New books', new_books_path %>
RAILS_ROOT: /home/jhzyb/myproject/test
Application Trace | Framework Trace | Full Trace
app/views/books/index.html.erb:20:in _run_erb_47app47views47books47index46html46erb'index'
app/controllers/books_controller.rb:7:in