Skip to content

Commit 4724ff3

Browse files
committed
Add a Static Pages controller
1 parent aa5907d commit 4724ff3

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class StaticPagesController < ApplicationController
2+
def home
3+
end
4+
5+
def help
6+
end
7+
end

app/helpers/static_pages_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module StaticPagesHelper
2+
end

app/views/static_pages/help.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>StaticPages#help</h1>
2+
<p>Find me in app/views/static_pages/help.html.erb</p>

app/views/static_pages/home.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>StaticPages#home</h1>
2+
<p>Find me in app/views/static_pages/home.html.erb</p>

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
Rails.application.routes.draw do
2+
get 'static_pages/home'
3+
get 'static_pages/help'
24
root "application#hello"
35
end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require "test_helper"
2+
3+
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
4+
test "should get home" do
5+
get static_pages_home_url
6+
assert_response :success
7+
end
8+
9+
test "should get help" do
10+
get static_pages_help_url
11+
assert_response :success
12+
end
13+
end

0 commit comments

Comments
 (0)