【发布时间】:2011-05-07 19:27:34
【问题描述】:
我正在关注来自 railstutorial.org 的 Michael Hartl 的截屏视频。根据第5章,我改变了 config/routes.rb 到:
SampleApp::Application.routes.draw do
match '/contact', :to => 'pages#contact'
match '/about', :to => 'pages#about'
match '/help', :to => 'pages#help'
root :to => 'pages#home'
end
和 _footer.html.erb 到:
和 _header.html.erb 到:
<% logo = image_tag("logo.png", :alt => "Sample App", :class => "round") %>
<%= link_to logo, root_path %>
<nav class="round">
<ul>
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Help", help_path %></li>
我是 Ruby on Rails 的新手。我在浏览器中遇到路由错误
没有路线匹配“/pages/contact”
我正在使用 ruby 1.9.2p180(2011-02-18 修订版 30909)[x86_64-linux], 导轨 3.0.7 和 gem 1.6.2 请帮忙。
【问题讨论】:
标签: ruby-on-rails-3 routes rails-routing railstutorial.org