Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated broken files.

  • Loading branch information...
commit 0b9a12e56069b41bc399a0675e4f8efe3881cab7 1 parent 52eca60
Scott Haines authored
4 week_five/faux-twitter/app/controllers/signup_controller.rb
View
@@ -1,4 +1,5 @@
class SignupController < ApplicationController
+
def new
# get
# User.new
@@ -14,6 +15,7 @@ def create
if params[:commit] == "Sign Up"
# We know the user actually pressed a button to get here
@user = User.new(params[:user])
+ #if @user.save && !@user.new_record?
if @user.save
flash[:notice] = "Horray. You have completed your Signup. We were able to Save your Account."
redirect_to home_path
@@ -21,8 +23,8 @@ def create
if @user.errors
render :action => :new
end
+
end
end
-
end
end
2  week_five/faux-twitter/app/models/user.rb
View
@@ -1,6 +1,6 @@
class User < ActiveRecord::Base
#User(id: integer, username: string, password: string, email: string, created_at: datetime, updated_at: datetime)
-
+ puts "USER BEING CREATED"
validates :username, :presence => true
validates :username, :uniqueness => true
validates :email,
5 week_five/faux-twitter/app/views/signup/new.html.erb
View
@@ -1,12 +1,9 @@
<div class="main_form_wrapper">
- <% if @user.errors.count >= 1 || flash[:error]%>
+ <% if @user.errors.count >= 1%>
<div id="errors">
<% @user.errors.each do |error,message|%>
<span class="error_span"><span class="spec_error"><%= error %></span> <%= message %></span>
<% end %>
- <% if flash[:error]%>
- <span class="error_span"><span class="spec_error"><%= flash[:error]%></span>
- <% end %>
</div>
<% end %>
<%= form_for @user, :url => { :controller => 'signup', :action => "create" }, :html => {:class => "user_forms"} do |f| %>
8 week_five/faux-twitter/config/routes.rb
View
@@ -11,6 +11,10 @@
get "user_preference/edit"
get "user_preference/destroy"
+
+ get "signup/new"
+
+ post "signup/create"
@@ -18,12 +22,12 @@
match 'signup' => "signup#new"
match 'session/destroy' => "session#destroy"
- match 'status/new' => "status#new"
+ #match 'status/new' => "status#new"
resources :user
resources :status
resources :session
- resources :signup
+ #resources :signup
# Sample resource route with more complex sub-resources
# resources :products do
Please sign in to comment.
Something went wrong with that request. Please try again.