form_for undefined method `user_path'

前端 未结 3 1849
梦谈多话
梦谈多话 2020-12-07 16:21

I\'m getting an error :

undefined method `user_path\' for #<#:0x007fd1f2241af0>

when I\'m trying to edi

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 16:58

    If you are here because of the namespace (like me 10 minutes ago) you'll need this:

    For namespaced routes, like admin_post_url:

    <%= form_for([:admin, @post]) do |f| %>
     ...
    <% end %>
    

    from the doc

提交回复
热议问题