Skip to content

Commit

Permalink
Generate pages controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilloughby committed Dec 4, 2022
1 parent 1ec3b32 commit f1ea083
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class PagesController < ApplicationController
def home
end
end
2 changes: 2 additions & 0 deletions app/helpers/pages_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PagesHelper
end
4 changes: 4 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<h1 class="font-bold text-4xl">Pages#home</h1>
<p>Find me in app/views/pages/home.html.erb</p>
</div>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Rails.application.routes.draw do
get 'pages/home'
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

# Defines the root path route ("/")
Expand Down
8 changes: 8 additions & 0 deletions test/controllers/pages_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "test_helper"

class PagesControllerTest < ActionDispatch::IntegrationTest
test "should get home" do
get pages_home_url
assert_response :success
end
end

0 comments on commit f1ea083

Please sign in to comment.