为什么我的API Pie参数没有显示?

时间:2018-10-24 18:58:29

标签: ruby-on-rails ruby apipie

我为我的方法创建了文档,并且顶层方法描述及其动词一起显示,但是当我单击任何这些链接时,它告诉我“糟糕!方法create.en找不到资源questions。”

这是我的代码示例:

  api :DELETE, '/questions/:id', 'Deletes question. Note that the delete cascades and also removes any child questions.'
  param :id, :number
  def destroy
    @question = Question.find(params[:id])
    @question.destroy_cascade
    head :ok
  end

这是页面的样子–所有这些链接都将我带到错误页面

enter image description here

奇怪的是,如果我查看json版本,那似乎还不错(即它包含所有信息)。

1 个答案:

答案 0 :(得分:0)

我最终需要将这些行添加到初始化程序中

  config.default_locale          = 'en'
  config.languages               = ['en']
相关问题