Browse Source

Add Static Pages controller for public pages

Maarten van den Berg 8 years ago
parent
commit
b62d35ed65

+ 3 - 0
app/assets/javascripts/static_pages.coffee

@@ -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/

+ 3 - 0
app/assets/stylesheets/static_pages.scss

@@ -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/

+ 10 - 0
app/controllers/static_pages_controller.rb

@@ -0,0 +1,10 @@
1
+class StaticPagesController < ApplicationController
2
+  def home
3
+  end
4
+
5
+  def sign_in
6
+  end
7
+
8
+  def sign_up
9
+  end
10
+end

+ 2 - 0
app/helpers/static_pages_helper.rb

@@ -0,0 +1,2 @@
1
+module StaticPagesHelper
2
+end

+ 2 - 0
app/views/static_pages/home.html.erb

@@ -0,0 +1,2 @@
1
+<h1>StaticPages#home</h1>
2
+<p>Find me in app/views/static_pages/home.html.erb</p>

+ 2 - 0
app/views/static_pages/sign_in.html.erb

@@ -0,0 +1,2 @@
1
+<h1>StaticPages#sign_in</h1>
2
+<p>Find me in app/views/static_pages/sign_in.html.erb</p>

+ 2 - 0
app/views/static_pages/sign_up.html.erb

@@ -0,0 +1,2 @@
1
+<h1>StaticPages#sign_up</h1>
2
+<p>Find me in app/views/static_pages/sign_up.html.erb</p>

+ 6 - 0
config/routes.rb

@@ -1,3 +1,9 @@
1 1
 Rails.application.routes.draw do
2
+  get 'static_pages/home'
3
+
4
+  get 'static_pages/sign_in'
5
+
6
+  get 'static_pages/sign_up'
7
+
2 8
   # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3 9
 end

+ 19 - 0
test/controllers/static_pages_controller_test.rb

@@ -0,0 +1,19 @@
1
+require 'test_helper'
2
+
3
+class StaticPagesControllerTest < ActionDispatch::IntegrationTest
4
+  test "should get home" do
5
+    get static_pages_home_url
6
+    assert_response :success
7
+  end
8
+
9
+  test "should get sign_in" do
10
+    get static_pages_sign_in_url
11
+    assert_response :success
12
+  end
13
+
14
+  test "should get sign_up" do
15
+    get static_pages_sign_up_url
16
+    assert_response :success
17
+  end
18
+
19
+end