Conditionally hide a portion of a partial when viewed from another controller

Posted by user284194 on Stack Overflow See other posts from Stack Overflow or by user284194
Published on 2010-05-28T04:31:06Z Indexed on 2010/05/28 4:41 UTC
Read the original article Hit count: 274

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.tags.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? Thanks for reading my question.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about uiviewcontroller