Permalink
Browse files

some more tidying

  • Loading branch information...
1 parent 90eb26c commit 6ed224042888a020dfcfdc434e18142635a3ed98 @gdagley committed Sep 19, 2009
View
2 app/controllers/contacts_controller.rb
@@ -8,7 +8,7 @@ def create
if @contact.valid?
Notifier.deliver_contact(@contact)
flash[:success] = 'Your contact information has been submitted and someone will contact you soon.'
- redirect_to root_path
+ redirect_to root_url
else
render :action => 'show'
end
View
6 app/controllers/password_resets_controller.rb
@@ -11,7 +11,7 @@ def create
@user.deliver_password_reset_instructions!
flash[:success] = "Instructions to reset your password have been emailed to you. " +
"Please check your email."
- redirect_to root_path
+ redirect_to root_url
else
flash[:notice] = "No user was found with that email address"
render :action => 'show'
@@ -26,7 +26,7 @@ def update
@user.password_confirmation = params[:user][:password_confirmation]
if @user.save
flash[:success] = "Password successfully updated"
- redirect_to account_path
+ redirect_to account_url
else
render :action => :edit
end
@@ -40,7 +40,7 @@ def load_user_using_perishable_token
"If you are having issues try copying and pasting the URL " +
"from your email into your browser or restarting the " +
"reset password process."
- redirect_to root_path
+ redirect_to root_url
end
end
end
View
5 app/controllers/user_sessions_controller.rb
@@ -1,4 +1,5 @@
class UserSessionsController < ApplicationController
+ before_filter :require_no_user, :only => [:new, :create]
before_filter :require_user, :only => :destroy
def new
@@ -9,7 +10,7 @@ def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:success] = "You are now logged in."
- redirect_back_or_default account_path
+ redirect_back_or_default account_url
else
render :action => :new
end
@@ -18,6 +19,6 @@ def create
def destroy
current_user_session.destroy
flash[:success] = "You have been logged out."
- redirect_back_or_default root_path
+ redirect_back_or_default root_url
end
end
View
4 app/controllers/users_controller.rb
@@ -11,7 +11,7 @@ def create
@user.admin = User.count.zero?
if @user.save
flash[:success] = "Account registered!"
- redirect_back_or_default account_path
+ redirect_back_or_default account_url
else
render :action => :new
end
@@ -29,7 +29,7 @@ def update
@user = current_user # makes our views "cleaner" and more consistent
if @user.update_attributes(params[:user])
flash[:success] = "Account updated!"
- redirect_to account_path
+ redirect_to account_url
else
render :action => :edit
end

0 comments on commit 6ed2240

Please sign in to comment.