我收到以下错误:的ActionController :: UrlGenerationError在文章#编辑
没有路由匹配{:动作=> “秀”,:控制器=> “文章”,:ID =>零}缺少必需的键:[:id]
以下是显示错误的代码。
<%= form_for :article, url: article_path(@article), method: :patch do |f| %>
什么是这个错误,每当我点击从前一屏幕编辑,我想我发送文章ID。
这里是我的耙路输出
Prefix Verb URI Pattern Controller#Action
welcome_index GET /welcome/index(.:format) welcome#index
articles GET /articles(.:format) articles#index
POST /articles(.:format) articles#create
new_article GET /articles/new(.:format) articles#new
edit_article GET /articles/:id/edit(.:format) articles#edit
article GET /articles/:id(.:format) articles#show
PATCH /articles/:id(.:format) articles#update
PUT /articles/:id(.:format) articles#update
DELETE /articles/:id(.:format) articles#destroy
root GET / welcome#index
你可以发布你的'rake routes'输出吗? – Pavan
我已经在问题本身中包含了rake路由输出 – user3726986
当您将该行更改为'<%= form_for @article,url:article_path(@article),method :: patch do | f |时,会发生什么? %>'? – Pavan