title: How to hide an element if it's being viewed from a certain route?
body: <p>I've got a partial with a form in it. I would like to have control over which routes admin users are able to view this form in.</p>
  
  <p>There are two routes, advertisements/show, and advertisements/admin-edit. The partial is displayed in both views.</p>
  
  <p>I tried doing</p>
  
  <pre><code>&lt;%= unless current_user.admin %&gt;
    # display section of partial
  &lt;% end %&gt;
  </code></pre>
  
  <p>but this isn't optimal because it stop admins from being able to test the application from the advertisements/show route.</p>
  
  <p>Is there a way to hide the form if the current path is admin_edit_path?</p>