localhost:3000/static_pages/home にアクセスしようとすると、次のエラーが発生します。
SyntaxError in StaticPagesController#home
/Users/user/Sites/rails_projects/sample_app/app/helpers/application_helper.rb:9: syntax error, unexpected keyword_end, expecting $end
Rails.root: /Users/user/Sites/rails_projects/sample_app
Application Trace | Framework Trace | Full Trace
app/controllers/application_controller.rb:1:in `<top (required)>'
app/controllers/static_pages_controller.rb:1:in `<top (required)>'
routes.rb の内容:
SampleApp::Application.routes.draw do
get "static_pages/home"
get "static_pages/help"
get "static_pages/about"
get "static_pages/contact"
end
application_helper.rb の内容:
def full_title(page_title)
base_title = "Ruby on Rails Tutorial Sample App"
if page_title.empty?
base_title
else
"#{base_title} | #{page_title}"
end
end
end
static_pages_controller.rb の内容:
class StaticPagesController < ApplicationController
def home
end
def help
end
def about
end
def contact
end
end