Commit c22a1f06 by phuctmZigexn

Add a static page controller

parent 024530c4
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
// Place all the styles related to the static_pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://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
get 'static_pages/home'
get 'static_pages/help'
root 'application#hello'
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