Ruby on Rails初心者です。
Rails tutorialでの5章にて、どうしてもエラーを解決することができなく困っております。
力を貸していただけたら幸いです。
エラー内容
No route matches [GET] "/static_pages/home"
Rails.root: /home/ec2-user/environment/sample_app
Application Trace | Framework Trace | Full Trace
Helper HTTP Verb Path Controller#Action
Path / Url
root_path GET /
static_pages#home
help_path GET /help(.:format)
static_pages#help
about_path GET /about(.:format)
static_pages#about
contact_path GET /contact(.:format)
static_pages#contact
コード
sample_app/config/routes.rb
Rails.application.routes.draw do
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
end
layout/application.html.erb
<!DOCTYPE html> <html> <head> <title><%= full_title(yield(:title)) %></title> <%= csrf_meta_tags %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> <%= render 'layouts/shim' %> </head> <body> <%= render 'layouts/header' %> <div class="container"> <%= yield %> <%= render 'layouts/footer' %> </div> </body> </html>static_pages/home.html.erb
<div class="center jumbotron"> <h1>Welcome to the Sample App</h1> <h2> This is the home page for the <a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a> sample application. </h2><%= link_to "Sign up now!", '#', class: "btn btn-lg btn-primary" %>
</div><%= link_to image_tag("rails.png", alt: "Rails logo"),
'http://rubyonrails.org/' %>
以上です。
よろしくお願い致します。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。