Skip to content

Commit

Permalink
Added a Pages controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ganesan committed Jun 16, 2011
1 parent 5f3a07d commit 7b826e6
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class PagesController < ApplicationController
def home
end

def contact
end

end
2 changes: 2 additions & 0 deletions app/helpers/pages_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module PagesHelper
end
2 changes: 2 additions & 0 deletions app/views/pages/contact.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Pages#contact</h1>
<p>Find me in app/views/pages/contact.html.erb</p>
2 changes: 2 additions & 0 deletions app/views/pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>Pages#home</h1>
<p>Find me in app/views/pages/home.html.erb</p>
3 changes: 3 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Rails3tutorial::Application.routes.draw do
get "pages/home"
get "pages/contact"

# The priority is based upon order of creation:
# first created -> highest priority.

Expand Down
19 changes: 19 additions & 0 deletions spec/controllers/pages_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper'

describe PagesController do

describe "GET 'home'" do
it "should be successful" do
get 'home'
response.should be_success
end
end

describe "GET 'contact'" do
it "should be successful" do
get 'contact'
response.should be_success
end
end

end
15 changes: 15 additions & 0 deletions spec/helpers/pages_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'spec_helper'

# Specs in this file have access to a helper object that includes
# the PagesHelper. For example:
#
# describe PagesHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# helper.concat_strings("this","that").should == "this that"
# end
# end
# end
describe PagesHelper do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/views/pages/contact.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe "pages/contact.html.erb" do
pending "add some examples to (or delete) #{__FILE__}"
end
5 changes: 5 additions & 0 deletions spec/views/pages/home.html.erb_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'spec_helper'

describe "pages/home.html.erb" do
pending "add some examples to (or delete) #{__FILE__}"
end
20 changes: 20 additions & 0 deletions working/learningmemo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#Memo

git remote add origin git@github.com:ganesan/newrails3tutorial.git
git push -u origin master


gem install heroku
heroku create

git push heroku master
git push
git push heroku

#Open to Browser
heroku open


#Create controller
$rails generate controller Pages home contact

0 comments on commit 7b826e6

Please sign in to comment.