Skip to content

Commit

Permalink
Creating and About pages
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacnotnwton committed Apr 10, 2014
1 parent 3c22eb2 commit 8b9ec14
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/assets/javascripts/pages.js.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/pages.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the pages 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/pages_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class PagesController < ApplicationController
def home
end

def about
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
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
</head>
<body>

<%= yield %>
<%= link_to "Home", root_path%>
<%= link_to "About Us", about_path%>
<%= yield %>

</body>
</html>
2 changes: 2 additions & 0 deletions app/views/pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h1>About us</h1>
<p>We are working on our One Month Rails Pinteresting app</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>Welcome to my app!</h1>
<p>Sign up <%= link_to "here", "#"%>.</p>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Pinteresting::Application.routes.draw do
root "pages#home"
get "about" => "pages#about" # create about_path
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

Expand Down
9 changes: 9 additions & 0 deletions test/controllers/pages_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'test_helper'

class PagesControllerTest < ActionController::TestCase
test "should get home" do
get :home
assert_response :success
end

end
4 changes: 4 additions & 0 deletions test/helpers/pages_helper_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'test_helper'

class PagesHelperTest < ActionView::TestCase
end

0 comments on commit 8b9ec14

Please sign in to comment.