- <% if current_user && current_user == diary_entry.user %>
- <li><%= link_to t(".edit_link"), :action => "edit", :display_name => diary_entry.user.display_name, :id => diary_entry.id %></li>
+ <% if can?(:edit, diary_entry) %>
+ <li><%= link_to t(".edit_link"), edit_diary_entry_path(diary_entry.user, diary_entry) %></li>