Home>
Routing Error
No route matches [POST] "/ items/new"
This error appears when implementing the posting function.
Resources: items, only: [: index,: new,: create] do in routes.rb
Why do I get a routing error even though I have mentioned?
class ItemsController</pre>
<pre><code>class Item</pre>
<pre><code>Rails.application.routes.draw do
devise_for: users
root to:'items # index'
resources: items, only: [: index,: new,: create] do
end
end
Thanks for your cooperation.
-
Answer # 1
-
Answer # 2
The HTML form_with was just not set.
<% = form_with (model: @item, local: true) do | f |%>
Related articles
- ruby - routing error no route matches [post] appears
- ruby - routing error no route matches [patch] i want to resolve "/ prototypes"
- jquery - [routing error] no route matches [patch] "/ tasks/1/edit"
- ruby on rails 6 - about rails routing error no route matches [get] "/"
- ruby - i want to resolve a routing error in the create action
- ruby - i got a routing error when i sent a comment
- ruby on rails 6 - error resolution for no route matches [delete]
- ruby on rails - rails routing error
- ruby on rails - [rails] i want to solve "no route matches [post]"/messages/search "" of "routing error&
- ruby on rails - i want to resolve a routing error
- ruby - i'm getting a routing error
- ruby on rails - no route matches , missing required keys: [: id] cannot be resolved
- ruby - i get a #routing error
- ruby - when i try to update rails, i get a routing error
- ruby - i get a routing error when i delete
- ruby routing error
- ruby on rails - cart function routing error cannot be resolved
- ruby - no route matches [patch]
- no route matches [patch] i want to resolve the error ruby on rails
Related questions
- ruby - about rails controller new action
- ruby - data including rails hyphen becomes # and is not displayed
- ruby - about viewport introduction
- ruby - n + 1 problem in api mode
- ruby - about customizing pagination with rails6 kaminari
- ruby - about rails routing
- ruby - link_to method:: post doesn't work
- ruby - rails6 active_strage cannot be installed
- ruby - unable to create table with foreign key
- ruby - how to pass the "password" on the wizard screen
In resources[POST]
"/ items/new"
Is not generated.new action is[GET]
"/ items/new"
Butcreate action is[POST]
"/ items"
Will be.This is
$rails routes
You can check it with a command.