No route matches with Nested Resources

荒凉一梦 提交于 2019-12-04 17:10:47
redirect_to @special

this will default to "specials_path", but you're using venue_special_path

you probably want:

redirect_to [@venue, @special]

and in the form you will need the same:

<%= form_for([@venue, @special]) do |f| %>

basically - the issue is that you have a nested resource... which means that every place where you are declaring a url path (including implicit places like form_for) has to be replaced with both the @venue and the @special, instead of just the @special.

you may come across this same "bug" elsewhere in your generated scaffold code... just do the same thing and you should be good.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!