Skip to content

Commit

Permalink
don't say following succeeded if it failed
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfwood authored and steveklabnik committed Mar 14, 2011
1 parent ed1c37e commit a009b70
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions rstatus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,13 @@ class Rstatus < Sinatra::Base
end

# then follow them!
current_user.follow! @user

flash[:notice] = "Now following #{params[:name]}."
redirect "/users/#{@user.username}"
unless current_user.follow! @user
flash[:notice] = "The was a problem following #{params[:name]}."
redirect "/users/#{@user.username}"
else
flash[:notice] = "Now following #{params[:name]}."
redirect "/users/#{@user.username}"
end
end

#this lets you unfollow a user
Expand Down

0 comments on commit a009b70

Please sign in to comment.