我尝试将location头添加到我的版本化API中。
NoMethodError (undefined method `forum_url' for #<V1::ForumsController:0x00000004fabaa0>):app/controllers/v1/forums_controller.rb:24:in `create'如何重写render location: forum助手来使用v1_forum_url而不是forum_url
发布于 2016-12-26 15:29:20
您可以简单地在控制器中定义一个方法forum_url:
def forum_url
v1_forum_url
end或者将自定义方法传递给location参数。
https://stackoverflow.com/questions/41332505
复制相似问题