I feel like this should be simple but for some reason I can't figure this out. I just want to add the edit and delete actions to the navbar when a user is on the show page.
I'm getting a route error saying the edit action doesn't exist on the homepage or the new page, here's my code:
layouts/application.html.haml
.nav-collapse
%ul.nav.pull-right
%li= link_to "All Articles", root_path
%li= link_to "New Article", new_article_path
- if current_page?(@article)
%li= link_to 'Edit', edit_article_path
%li= link_to 'Delete', { :action => :destroy, :id => @article.id }, :method => :delete, :confirm => 'Are you sure?'