【发布时间】:2020-05-18 01:38:02
【问题描述】:
目前我收到此错误
The action 'show' could not be found for Api::V1::ImagesController
我的路由文件是这样的
namespace :api do
namespace :v1 do
...
resources :images
...
end
end
我还可以看到资源方法没有按照the docs创建新端点
我暂时已经这样做了,但我很想知道是否有更清洁的解决方法:
class Api::V1::ImagesController < Api::BaseController
def show
new if params[:id] == "new"
end
def new
...
【问题讨论】:
标签: ruby-on-rails routes actioncontroller