I do something like a blog by tutorial, when reading or deleting a post, I get this error
I understand that the matter is in the parameters, but I cannot solve the problem Code: Controller
class ArticlesController < ApplicationController def show @article = Article.find(params[:id]) end def new @article = Article.new end def create @article = Article.new(articles_params) @article.save redirect_to '/' end def destroy @article = Article.find(params[:id]) @article.destroy! redirect_to 'root' end end private def articles_params params.require(:article).permit(:title,:text) end Viewport
new.erb <%= form_for :article, url: articles_path do |f| %> <p> <%= f.label :title %><br> <%= f.text_field :title%> </p> <p> <%= f.label :text %><br> <%= f.text_area :text%> </p> <p> <%= f.submit%> </p> <% end %> show.erb <p> <strong>Title:</strong> <%= @article.title %> </p> <p> <strong>Text:</strong> <%= @article.text %> </p> index.erb <h1>Listing articles</h1> <table> <tr> <th>Title</th> <th>Text</th> </tr> <%= link_to 'New Post', new_articles_path %> <% @article.each do |article| %> <tr> <td><%= article.title %></td> <td><%= article.text %></td> <td><%= link_to 'Show', articles_path(article),controller: 'articles' %></td> <td><%= link_to 'Destroy', articles_path(article), method: :delete, data: {confirm: 'Are you sure?' }%></td> </tr> <% end %> </table> Links
<a href="/articles/new">New Post</a> <tr> <td>asdafsd</td> <td>asdasdczxc</td> <td><a controller="articles" href="/articles.1">Show</a></td> <td><a controller="articles" data-confirm="Are you sure?" rel="nofollow" data-method="delete" href="/articles.1">Destroy</a></td> </tr> <tr> <td>sasdasdzxcxv</td> <td>dsfsvc</td> <td><a controller="articles" href="/articles.2">Show</a></td> <td><a controller="articles" data-confirm="Are you sure?" rel="nofollow" data-method="delete" href="/articles.2">Destroy</a></td> </tr> <tr> <td>sasdasdzxcxv</td> <td>dsfsvcx</td> <td><a controller="articles" href="/articles.3">Show</a></td> <td><a controller="articles" data-confirm="Are you sure?" rel="nofollow" data-method="delete" href="/articles.3">Destroy</a></td> Rake
Prefix Verb URI Pattern Controller#Action new_articles GET /articles/new(.:format) articles#new edit_articles GET /articles/edit(.:format) articles#edit articles GET /articles(.:format) articles#show PATCH /articles(.:format) articles#update PUT /articles(.:format) articles#update DELETE /articles(.:format) articles#destroy POST /articles(.:format) articles#create root GET / welcome#index 
controller: 'articles'link_to 'Destroy'line, as in the line above. - aleks.andrrake routesresult to the question. - Mikhail Vaysmanconfig/routes.rb- Mikhail Vaysman