Skip to content

Commit

Permalink
Step 2
Browse files Browse the repository at this point in the history
  • Loading branch information
matianxing1992 committed Jan 31, 2019
1 parent e3be8e4 commit dddd179
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/assets/javascripts/pages.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 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/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/pages.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Pages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
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
2 changes: 2 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Pages#home</h1>
<p>Find me in app/views/pages/home.html.erb</p>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Rails.application.routes.draw do
get 'pages/home'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
9 changes: 9 additions & 0 deletions test/controllers/pages_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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 dddd179

Please sign in to comment.