Skip to content

Commit a050f7d

Browse files
committed
Generate StaticPages controller w/ home action
1 parent edcc0bb commit a050f7d

File tree

9 files changed

+48
-0
lines changed

9 files changed

+48
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://coffeescript.org/
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the StaticPages controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class StaticPagesController < ApplicationController
2+
def home
3+
end
4+
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/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,4 +1,6 @@
11
Rails.application.routes.draw do
2+
get 'static_pages/home'
3+
24
# Render legal documents by using Keiyaku CSS
35
# https://github.com/cognitom/keiyaku-css
46
resources :docs, only: [:index, :show]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require 'rails_helper'
2+
3+
RSpec.describe StaticPagesController, type: :controller do
4+
5+
describe "GET #home" do
6+
it "returns http success" do
7+
get :home
8+
expect(response).to have_http_status(:success)
9+
end
10+
end
11+
12+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'rails_helper'
2+
3+
# Specs in this file have access to a helper object that includes
4+
# the StaticPagesHelper. For example:
5+
#
6+
# describe StaticPagesHelper do
7+
# describe "string concat" do
8+
# it "concats two strings with spaces" do
9+
# expect(helper.concat_strings("this","that")).to eq("this that")
10+
# end
11+
# end
12+
# end
13+
RSpec.describe StaticPagesHelper, type: :helper do
14+
pending "add some examples to (or delete) #{__FILE__}"
15+
end
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'rails_helper'
2+
3+
RSpec.describe "static_pages/home.html.erb", type: :view do
4+
pending "add some examples to (or delete) #{__FILE__}"
5+
end

0 commit comments

Comments
 (0)