Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add a StaticPages controller

  • Loading branch information...
commit e86b62784acac5a4ed7cd20b7605f30357fbbfca 1 parent 1f1dffe
itsjan authored October 07, 2012
3  app/assets/javascripts/static_pages.js.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://jashkenas.github.com/coffee-script/
3  app/assets/stylesheets/static_pages.css.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/
7  app/controllers/static_pages_controller.rb
... ...
@@ -0,0 +1,7 @@
  1
+class StaticPagesController < ApplicationController
  2
+  def home
  3
+  end
  4
+
  5
+  def help
  6
+  end
  7
+end
2  app/helpers/static_pages_helper.rb
... ...
@@ -0,0 +1,2 @@
  1
+module StaticPagesHelper
  2
+end
2  app/views/static_pages/help.html.erb
... ...
@@ -0,0 +1,2 @@
  1
+<h1>StaticPages#help</h1>
  2
+<p>Find me in app/views/static_pages/help.html.erb</p>
2  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>
4  config/routes.rb
... ...
@@ -1,4 +1,8 @@
1 1
 SampleApp::Application.routes.draw do
  2
+  get "static_pages/home"
  3
+
  4
+  get "static_pages/help"
  5
+
2 6
   # The priority is based upon order of creation:
3 7
   # first created -> highest priority.
4 8
 
9  public/hello.html
... ...
@@ -0,0 +1,9 @@
  1
+<!DOCTYPE html>
  2
+<html>
  3
+  <head>
  4
+    <title>Greeting</title>
  5
+  </head>
  6
+  <body>
  7
+    <p>Hello, world!</p>
  8
+  </body>
  9
+</html>

0 notes on commit e86b627

Please sign in to comment.
Something went wrong with that request. Please try again.