Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: halogenandtoast/intermediate_workshop
base: 1333f8f260
...
head fork: halogenandtoast/intermediate_workshop
compare: b716dc9850
  • 2 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
3  app/controllers/dashboards_controller.rb
@@ -0,0 +1,3 @@
+class DashboardsController < ApplicationController
+
+end
View
8 app/controllers/welcome_controller.rb
@@ -1,3 +1,11 @@
class WelcomeController < ApplicationController
+ before_filter :redirect_to_dashboard_when_signed_in
+ def index
+ @user = User.new
+ end
+ private
+ def redirect_to_dashboard_when_signed_in
+ redirect_to dashboard_path if signed_in?
+ end
end
View
3  app/models/shout.rb
@@ -0,0 +1,3 @@
+class Shout < ActiveRecord::Base
+ belongs_to :user
+end
View
1  app/views/dashboards/show.html.erb
@@ -0,0 +1 @@
+Welcome <%= current_user.email %>
View
11 app/views/welcome/index.html.erb
@@ -1 +1,12 @@
<h1>Shouter</h1>
+<%= form_for(@user) do |form| %>
+ <div>
+ <%= form.email_field :email, placeholder: "Email address" %>
+ </div>
+ <div>
+ <%= form.password_field :password, placeholder: "Password" %>
+ </div>
+ <div>
+ <%= form.submit "Sign up" %>
+ </div>
+<% end %>
View
1  config/routes.rb
@@ -1,3 +1,4 @@
Shouter::Application.routes.draw do
root to: "welcome#index"
+ resource :dashboard, only: [:show]
end
View
11 db/migrate/20120402150227_create_shouts.rb
@@ -0,0 +1,11 @@
+class CreateShouts < ActiveRecord::Migration
+ def change
+ create_table :shouts do |t|
+ t.string :body
+ t.belongs_to :user
+
+ t.timestamps
+ end
+ add_index :shouts, :user_id
+ end
+end
View
9 test/fixtures/shouts.yml
@@ -0,0 +1,9 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ body: MyString
+ user:
+
+two:
+ body: MyString
+ user:
View
7 test/unit/shout_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ShoutTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end

No commit comments for this range

Something went wrong with that request. Please try again.