current_user.following?(user)
的判断有点多
<%= link_to current_user.following?(user)? unfollow_user_path(user) : follow_user_path(user),
:class => current_user.following?(user)? 'btn btn-danger btn-block unfollow' : 'btn btn-primary btn-block follow',
:method => :put,
:remote => true do %>
<strong>
<%= current_user.following?(user)? '取消关注' : '关注' %>
</strong>
<span></span>
<% end %>
请大家帮忙看看能如何重构的漂亮点,谢谢。