Commit 66154e56 by Mai Hoang Thai Ha

Add a Static Pages controller

parent f31167a6
Pipeline #1187 failed with stages
in 0 seconds
// Place all the styles related to the StaticPages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
class StaticPagesController < ApplicationController
def home
end
def help
end
end
module StaticPagesHelper
end
<h1>StaticPages#help</h1>
<p>Find me in app/views/static_pages/help.html.erb</p>
<h1>StaticPages#home</h1>
<p>Find me in app/views/static_pages/home.html.erb</p>
Rails.application.routes.draw do Rails.application.routes.draw do
get 'static_pages/home'
get 'static_pages/help'
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root 'application#hello' root 'application#hello'
end end
require "test_helper"
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
test "should get home" do
get static_pages_home_url
assert_response :success
end
test "should get help" do
get static_pages_help_url
assert_response :success
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment