Skip to content

Instantly share code, notes, and snippets.

@gumayunov
Created February 14, 2009 11:32
Show Gist options
  • Save gumayunov/64337 to your computer and use it in GitHub Desktop.
Save gumayunov/64337 to your computer and use it in GitHub Desktop.
<div class="follow_toggler">
<%= link_to_remote "следить",
:url => user_follows_path(current_user.login, :target=>target_user.login) ,
:method => :post,
:success => "$('unfollow_action').hide();$('follow_action').show();",
:html => { :id => "unfollow_action", :class => "follow", :style => already_follow ? "display:none;" : "" } %>
<%= link_to_remote "не следить",
:url => user_follow_path(current_user.login, target_user.login),
:method => :delete,
:success => "$('follow_action').hide();$('unfollow_action').show();remove_user_from_follows('#{target_user.login}');",
:html => { :id => "follow_action", :class => "unfollow", :style => already_follow ? "" : "display:none;" } %>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment