<div class="tools pull-right">
<%= topic_follow_tag(@topic) %>
<%= likeable_tag(@topic) %>
<%= topic_favorite_tag(@topic) %>
<% if owner?(@topic) or admin? %>
<%= link_to "", edit_topic_path(@topic), :class => "icon small_edit", :title => "修改本帖" %>
<%= link_to "", topic_path(@topic.id), :method => :delete, 'data-confirm' => t("common.confirm_delete"), :class => "icon small_delete", :title => "删除本帖" %>
<% end %>
</div>
既然安装了 gem Cancan,上面一段为什么不使用 if can?
实在看不懂,求指点。
<div class="tools pull-right">
<%= topic_follow_tag(@topic) %>
<%= likeable_tag(@topic) %>
<%= topic_favorite_tag(@topic) %>
<% if can? %>
<%= link_to "", edit_topic_path(@topic), :class => "icon small_edit", :title => "修改本帖" %>
<%= link_to "", topic_path(@topic.id), :method => :delete, 'data-confirm' => t("common.confirm_delete"), :class => "icon small_delete", :title => "删除本帖" %>
<% end %>
</div>