Skip to content

Commit

Permalink
Add a Static Pages controller
Browse files Browse the repository at this point in the history
  • Loading branch information
supiccc committed Feb 15, 2017
1 parent 0bb3b50 commit c904b13
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 28 deletions.
97 changes: 69 additions & 28 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
ansi (1.5.0)
arel (7.1.4)
builder (3.2.3)
byebug (9.0.6)
byebug (9.0.0)
coderay (1.1.1)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.2.x)
Expand All @@ -53,13 +55,27 @@ GEM
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.17)
formatador (0.2.5)
globalid (0.3.7)
activesupport (>= 4.1.0)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-minitest (2.4.4)
guard-compat (~> 1.2)
minitest (>= 3.0)
i18n (0.8.0)
jbuilder (2.6.1)
jbuilder (2.4.1)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.2.2)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
Expand All @@ -68,6 +84,7 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.0.3)
nokogiri (>= 1.5.9)
lumberjack (1.0.11)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
Expand All @@ -76,11 +93,25 @@ GEM
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.10.1)
minitest-reporters (1.1.9)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
multi_json (1.12.1)
nenv (0.3.0)
nio4r (1.2.1)
nokogiri (1.7.0.1)
mini_portile2 (~> 2.1.0)
puma (3.7.0)
notiffany (0.1.1)
nenv (~> 0.1)
shellany (~> 0.0)
pg (0.18.4)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
puma (3.4.0)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -96,6 +127,10 @@ GEM
bundler (>= 1.3.0, < 2.0)
railties (= 5.0.1)
sprockets-rails (>= 2.0.0)
rails-controller-testing (0.1.1)
actionpack (~> 5.x)
actionview (~> 5.x)
activesupport (~> 5.x)
rails-dom-testing (2.0.2)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6)
Expand All @@ -111,26 +146,28 @@ GEM
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
ruby-progressbar (1.8.1)
sass (3.4.23)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
spring (2.0.1)
activesupport (>= 4.2)
spring-watcher-listen (2.0.1)
shellany (0.0.1)
slop (3.6.0)
spring (1.7.2)
spring-watcher-listen (2.0.0)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
spring (~> 1.2)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
sqlite3 (1.3.12)
thor (0.19.4)
thread_safe (0.3.5)
tilt (2.0.6)
Expand All @@ -139,13 +176,12 @@ GEM
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.4)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
web-console (3.4.0)
actionview (>= 5.0)
activemodel (>= 5.0)
web-console (3.1.1)
activemodel (>= 4.2)
debug_inspector
railties (>= 5.0)
railties (>= 4.2)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
Expand All @@ -154,21 +190,26 @@ PLATFORMS
ruby

DEPENDENCIES
byebug
coffee-rails (~> 4.2)
jbuilder (~> 2.5)
jquery-rails
listen (~> 3.0.5)
puma (~> 3.0)
rails (~> 5.0.1)
sass-rails (~> 5.0)
spring
spring-watcher-listen (~> 2.0.0)
sqlite3
turbolinks (~> 5)
byebug (= 9.0.0)
coffee-rails (= 4.2.1)
guard (= 2.13.0)
guard-minitest (= 2.4.4)
jbuilder (= 2.4.1)
jquery-rails (= 4.1.1)
listen (= 3.0.8)
minitest-reporters (= 1.1.9)
pg (= 0.18.4)
puma (= 3.4.0)
rails (= 5.0.1)
rails-controller-testing (= 0.1.1)
sass-rails (= 5.0.6)
spring (= 1.7.2)
spring-watcher-listen (= 2.0.0)
sqlite3 (= 1.3.12)
turbolinks (= 5.0.1)
tzinfo-data
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
uglifier (= 3.0.0)
web-console (= 3.1.1)

BUNDLED WITH
1.13.6
3 changes: 3 additions & 0 deletions app/assets/javascripts/static_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/static_pages.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the StaticPages controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
7 changes: 7 additions & 0 deletions app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class StaticPagesController < ApplicationController
def home
end

def help
end
end
2 changes: 2 additions & 0 deletions app/helpers/static_pages_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module StaticPagesHelper
end
2 changes: 2 additions & 0 deletions app/views/static_pages/help.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>StaticPages#help</h1>
<p>Find me in app/views/static_pages/help.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>StaticPages#home</h1>
<p>Find me in app/views/static_pages/home.html.erb</p>
4 changes: 4 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Rails.application.routes.draw do
get 'static_pages/home'

get 'static_pages/help'

# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
root 'application#hello'
end
14 changes: 14 additions & 0 deletions test/controllers/static_pages_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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

0 comments on commit c904b13

Please sign in to comment.