Ruby On Rails路由错误 - 没有路由匹配

时间:2013-02-04 13:56:12

标签: ruby-on-rails-3.2 rails-routing

我知道有很多问题在打开之前有相同的标题,但我无法找到合适的答案。

URI:http:// localhost:3000/user/register

错误:No route matches {:action=>"about", :controller=>"user"}

日志:

Processing by UserController#index as HTML
Rendered user/index.html.erb within layouts/application (12.0ms)
Completed 500 Internal Server Error in 82ms

ActionController::RoutingError (No route matches {:action=>"about", :controller=>"user"}):
app/views/layouts/application.html.erb:14:in `_app_views_layouts_application_html_erb__379156404_34959024'

我的路线:

Sample::Application.routes.draw do
  root :to => "site#index"

  get "site/index"

  get "site/about"

  get "site/help"

  get "user/index"

  get "user/register" => "user#register"

Ruby版本:ruby 1.9.3p125 (2012-02-16) [i386-mingw32]

Rails版本:Rails 3.2.11

请帮我解决这个路由问题。

1 个答案:

答案 0 :(得分:0)

不应该是get "user/register" => "users#register"吗? 控制器通常是复数。