【发布时间】:2012-09-16 03:23:00
【问题描述】:
我正在使用 Rails 3.2.7。我有一个控制器和一个动作,如下所示:
class BookController < ApplicationController
def list
@books = Book.find(:all)
end
end
我还在模型下创建了一个名为 book.rb 的模型,并在 \app\views\book 文件夹中创建了一个 list.rhtml。当我点击http://127.0.0.1:3000/book/list 时,我收到了这个错误:
No route matches [GET] "/book/list"**
这里是config/routes.rb:
Ravi::Application.routes.draw do
# The priority is based upon order of creation:
# first created -> highest priority.
# rest of the explanations in default "config/routes.rb"
end
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3.1 rails-routing