Skip to content

Commit

Permalink
generated controller for staticpages
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagonbotelho committed May 9, 2015
1 parent 12a6e5a commit 00c3f09
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 0 deletions.
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'

# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

Expand Down
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 < ActionController::TestCase
test "should get home" do
get :home
assert_response :success
end

test "should get help" do
get :help
assert_response :success
end

end

0 comments on commit 00c3f09

Please sign in to comment.