title: If Statement within Views in Rails 3
body: <p>Ok so i have been starting to get used to rails 3 over the past few days and have got a project in the works to test things out on. Is it possible to do the following or what would you suggest is the best way to only allow post authors to edit their posts.</p>
  
  <pre><code>&lt;% if post.author_id == current_user.id %&gt;
     &lt;td&gt;&lt;%= link_to 'Edit', edit_post_path(post) %&gt;&lt;/td&gt;
     &lt;td&gt;&lt;%= link_to 'Destroy', post, :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt;&lt;/td&gt;
  &lt;% end %&gt;
  </code></pre>