<% member = ContestMember.where("user_id = #{@user.id} and contest_id = #{contest.id}").first %> <% if User.current == @user %> <% if member %> <%= link_to "", cancel_or_collect_user_path(@user, :contest => contest.id), :class => "#{member.is_collect == true ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}", :target => '_blank', :remote => true, :title => "#{member.is_collect == true ? '点击将其从左侧导航的竞赛列表中移除' : '点击将其添加至左侧导航的竞赛列表中'}" %> <% end %> <% else %> <% if member %> <% end %> <% end %>