Missing template api/v2/subjects/fetch_subject, api/base/fetch_subject, application/fetch_subject with {:locale=>[:"zh-CN"], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}.
新建的fetch_subject.json.jbuilder在接口访问不到,
http://localhost:3000/api/v2/subjects/516?for_fetch=true
两种方法
(方法一)
http://localhost:3000/api/v2/subjects/516.json?for_fetch=true
(方法2)
if params[:for_fetch].present?
render :fetch_subject, formats: [:json]
else
render :show
end