Skip to content

Commit

Permalink
some more tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
gdagley committed Sep 19, 2009
1 parent 90eb26c commit 6ed2240
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/contacts_controller.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def create
if @contact.valid? if @contact.valid?
Notifier.deliver_contact(@contact) Notifier.deliver_contact(@contact)
flash[:success] = 'Your contact information has been submitted and someone will contact you soon.' flash[:success] = 'Your contact information has been submitted and someone will contact you soon.'
redirect_to root_path redirect_to root_url
else else
render :action => 'show' render :action => 'show'
end end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/password_resets_controller.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create
@user.deliver_password_reset_instructions! @user.deliver_password_reset_instructions!
flash[:success] = "Instructions to reset your password have been emailed to you. " + flash[:success] = "Instructions to reset your password have been emailed to you. " +
"Please check your email." "Please check your email."
redirect_to root_path redirect_to root_url
else else
flash[:notice] = "No user was found with that email address" flash[:notice] = "No user was found with that email address"
render :action => 'show' render :action => 'show'
Expand All @@ -26,7 +26,7 @@ def update
@user.password_confirmation = params[:user][:password_confirmation] @user.password_confirmation = params[:user][:password_confirmation]
if @user.save if @user.save
flash[:success] = "Password successfully updated" flash[:success] = "Password successfully updated"
redirect_to account_path redirect_to account_url
else else
render :action => :edit render :action => :edit
end end
Expand All @@ -40,7 +40,7 @@ def load_user_using_perishable_token
"If you are having issues try copying and pasting the URL " + "If you are having issues try copying and pasting the URL " +
"from your email into your browser or restarting the " + "from your email into your browser or restarting the " +
"reset password process." "reset password process."
redirect_to root_path redirect_to root_url
end end
end end
end end
5 changes: 3 additions & 2 deletions app/controllers/user_sessions_controller.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
class UserSessionsController < ApplicationController class UserSessionsController < ApplicationController
before_filter :require_no_user, :only => [:new, :create]
before_filter :require_user, :only => :destroy before_filter :require_user, :only => :destroy


def new def new
Expand All @@ -9,7 +10,7 @@ def create
@user_session = UserSession.new(params[:user_session]) @user_session = UserSession.new(params[:user_session])
if @user_session.save if @user_session.save
flash[:success] = "You are now logged in." flash[:success] = "You are now logged in."
redirect_back_or_default account_path redirect_back_or_default account_url
else else
render :action => :new render :action => :new
end end
Expand All @@ -18,6 +19,6 @@ def create
def destroy def destroy
current_user_session.destroy current_user_session.destroy
flash[:success] = "You have been logged out." flash[:success] = "You have been logged out."
redirect_back_or_default root_path redirect_back_or_default root_url
end end
end end
4 changes: 2 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create
@user.admin = User.count.zero? @user.admin = User.count.zero?
if @user.save if @user.save
flash[:success] = "Account registered!" flash[:success] = "Account registered!"
redirect_back_or_default account_path redirect_back_or_default account_url
else else
render :action => :new render :action => :new
end end
Expand All @@ -29,7 +29,7 @@ def update
@user = current_user # makes our views "cleaner" and more consistent @user = current_user # makes our views "cleaner" and more consistent
if @user.update_attributes(params[:user]) if @user.update_attributes(params[:user])
flash[:success] = "Account updated!" flash[:success] = "Account updated!"
redirect_to account_path redirect_to account_url
else else
render :action => :edit render :action => :edit
end end
Expand Down

0 comments on commit 6ed2240

Please sign in to comment.