Skip to content

Commit

Permalink
clean up event follow button and response
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostandthemachine committed Nov 24, 2012
1 parent 8faa0f8 commit 1efa401
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/views/event/event.haml
Expand Up @@ -19,7 +19,7 @@
-if current_user.following?(event.user)
%p.btn.btn-primary.following-btn= "Following #{event.user.user_name}"
-else
%a.btn.btn-warning.follow-btn{id: "followed-user-#{event.user.id}"}= "Follow #{event.user.user_name}"
%a.btn.btn-warning.follow-btn{id: "followed-user-#{event.user.user_name}-#{event.user.id}"}= "Follow #{event.user.user_name}"
.row
%h4= "comments"
%hr
Expand All @@ -45,7 +45,8 @@

$('.follow-btn').click(function(e) {
var obj = event.target;
var followed_user_id = $(obj).attr('id').split('-')[2];
var followed_user_id = $(obj).attr('id').split('-')[3];
var followed_username = $(obj).attr('id').split('-')[2];
$.ajax({
type: "POST",
url: '/api/update/user/follow',
Expand Down

0 comments on commit 1efa401

Please sign in to comment.