我想只有在当前用户是“主人”,但即使主人的用户ID匹配的用户ID为客人条件显示Rails的
<%= link_to "X" , "/songs?name=#{s.name}&party_profile_id=#{s.party_profile_id}&commit=X", :remote => true, :class => "btn btn-inverse btn-small refreshbutton", :style => "display:none" unless @current_user.id == @party_profile.host %>
按钮被隐藏,显示删除按钮
我使用错误的语法吗?有没有更好的方式来有条件地显示项目?
是'@ party_profile.host'一个整数,因为'@ current_user.id'几乎可以肯定是,我不知道,如果他们能永远是一样的事情。 – stephenmurdoch 2013-02-18 21:14:02