Skip to content

Commit

Permalink
Ooops, only you should be able to start and stop following people
Browse files Browse the repository at this point in the history
  • Loading branch information
danlucraft committed May 24, 2009
1 parent db6e1e4 commit 74df792
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ def redis
get '/:follower/follow/:followee' do |follower_username, followee_username|
follower = User.find_by_username(follower_username)
followee = User.find_by_username(followee_username)
redirect '/' unless @logged_in_user == follower
follower.follow(followee)
redirect "/" + followee_username
end

get '/:follower/stopfollow/:followee' do |follower_username, followee_username|
follower = User.find_by_username(follower_username)
followee = User.find_by_username(followee_username)
redirect '/' unless @logged_in_user == follower
follower.stop_following(followee)
redirect "/" + followee_username
end
Expand Down

0 comments on commit 74df792

Please sign in to comment.