レシピブログのサンプルをつくろうとしています。
routes.rb に全てのurlをモーラするようにresources :recipesと記載しているのに、
なぜか、editページのurlになるとshowページで出てきてしまいます。
rails generate Recipes index show new edit とコマンドで作成したのですが、
index show new のみ反映して
postなどのaction全てrouteがないと言われてしまいます。
raketoutesで作られているようにみえるのですが実際動かすと反映しないのです。
こんなこと初めてでこまっております。
rake routes Prefix Verb URI Pattern Controller#Action recipes_index GET /recipes/index(.:format) recipes#index root GET / recipes#index recipes GET /recipes(.:format) recipes#index POST /recipes(.:format) recipes#create new_recipe GET /recipes/new(.:format) recipes#new edit_recipe GET /recipes/:id/edit(.:format) recipes#edit recipe GET /recipes/:id(.:format) recipes#show PATCH /recipes/:id(.:format) recipes#update PUT /recipes/:id(.:format) recipes#update DELETE /recipes/:id(.:format) recipes#destroy```
routes.rb
Rails.application.routes.draw do
root 'recipes#index'
resources :recipes
どうぞよろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー