title: Remove Logic from Rails Views
body: <p>Is there a way I can clean up my views when it comes to an example below like user links? I remember reading in a book remove if and else statements put it into a controller or something. Can't find it at the moment.</p>
  
  <pre><code>&lt;% if current_user %&gt;
      &lt;%= link_to edit_post_path(blog) do %&gt;
          &lt;i class="fas fa-edit"&gt;&lt;/i&gt; Edit Post
      &lt;% end %&gt;
      &lt;%= link_to blog_post_index do %&gt;
          &lt;i class="fas fa-trash"&gt;&lt;/i&gt; Delete Post
      &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>