开发者

How to modify partial, depending on controller it's viewed from?

I'm using a partial from my "messages" controller in my "tags" controller. The portion in question looks like this:

  <% unless message.tag_list.nil? || message.tag_list.empty? %>
    <% message.ta开发者_如何学编程gs.each do |t| %>
      <div class="tag"><%= link_to t.name.titleize, tag_path(t) %></div>
    <% end %>
  <% end %>

Is there a way to hide this portion of the partial only when it is viewed from the "tags" controller?


<% unless controller.controller_name.eql?("tags") %>
   will only show if controller is NOT tags 
<% end %>

:) hope that helps!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜