Skip to content
Browse files

Finishes layouts routes and added User controller and spec

  • Loading branch information...
1 parent 78966ac commit a1b8287ce2e251e0e9cc6460d2e768eb7b596ec8 @safalmj committed Sep 3, 2012
View
3 app/assets/javascripts/users.js.coffee
@@ -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://jashkenas.github.com/coffee-script/
View
3 app/assets/stylesheets/users.css.scss
@@ -0,0 +1,3 @@
+// Place all the styles related to the Users controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
View
4 app/controllers/users_controller.rb
@@ -0,0 +1,4 @@
+class UsersController < ApplicationController
+ def new
+ end
+end
View
2 app/helpers/users_helper.rb
@@ -0,0 +1,2 @@
+module UsersHelper
+end
View
2 app/views/layouts/_header.html.erb
@@ -6,7 +6,7 @@
<ul class="nav pull-right">
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Help", help_path %></li>
- <li><%= link_to "Sign in", '#' %></li>
+ <li><%= link_to "Sign in", signup_path %></li>
</ul>
</nav>
</div>
View
2 app/views/static_pages/home.html.erb
@@ -12,7 +12,7 @@
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</h2>
- <%= link_to "Sign up now!", "#", :class => "btn btn-large btn-primary" %>
+ <%= link_to "Sign up now!", signup_path, :class => "btn btn-large btn-primary" %>
</div>
<%= link_to image_tag("rails.png", :alt => "Rails"), 'http://rubyonrails.org/' %>
View
3 app/views/users/new.html.erb
@@ -0,0 +1,3 @@
+<% provide(:title, 'Sign Up')%>
+<h1>Sign up</h1>
+<p>Find me in app/views/users/new.html.erb</p>
View
3 config/routes.rb
@@ -1,9 +1,12 @@
SampleApp::Application.routes.draw do
+ get "users/new"
+
root :to => "static_pages#home"
match "/help", :to => "static_pages#help"
match "/about", :to => "static_pages#about"
match "/contact", :to => "static_pages#contact"
+ match "/signup", :to => 'users#new'
# The priority is based upon order of creation:
# first created -> highest priority.
View
16 db/schema.rb
@@ -0,0 +1,16 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 0) do
+
+end
View
13 spec/requests/user_pages_spec.rb
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe "User Pages" do
+ let(:base_title) {"Ruby on Rails Tutorial Sample App"}
+ subject { page }
+
+ describe "signup page" do
+ before { visit signup_path}
+ it { should have_selector('h1', :text => 'Sign up')}
+ it { should have_selector('title', :text => "#{base_title} | Sign Up" )}
+ end
+
+end

0 comments on commit a1b8287

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