Undefined method _s_path in form_for

不想你离开。 提交于 2019-12-04 19:48:37

Since the route for workouts is nested under a user resource you want this format (IIRC) for the form_for:

form_for [@user, @workout] do |f|

In my case, my problem was that my nested controller (ExpansionController) had a singular name and its parent (EditionsController) a plural name. I've changed my nested controller name to plural (ExpansionsController), its routes and it worked.

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