我folllowed此: http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:user_signup 。Rails项目,“路由错误没有路由匹配”/页“”需要帮助
但是,当我尝试访问http://localhost:3000/pages/返回“路由错误的路由匹配‘/页’”
这是我的routes.rb
Sample4App::Application.routes.draw do
get "users/new"
match '/signup', :to => 'users#new'
match '/contact', :to => 'pages#contact'
match '/about', :to => 'pages#about'
match '/help', :to => 'pages#help'
match '/', :to => 'pages#home'
end
这是我home.html.erb
<h1>Sample App</h1>
<p>
This is the home page for the
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</p>
<%= link_to "Sign up now!", signup_path, :class => "signup_button round" %>
我尽力了。但仍然。 真的需要帮助。谢谢
谢谢,但不行。实际上,根(/')是东西'网页#家' –
好吧,我只是假设你想/页面被路由到家里,因为你没有指定。但如果这是不正确的,那么当你浏览/页面时你想要发生什么? – DanneManne
@Josh Morrison,这是你想要的。 @DanneManne,'搭配'更好用'get'取代 – fl00r