これは単純なはずですが、何らかの理由でこれを理解できません。ユーザーが表示ページにいるときに、編集および削除アクションをナビゲーションバーに追加したいだけです。
ホームページまたは新しいページに編集アクションが存在しないというルート エラーが表示されます。コードは次のとおりです。
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?'