0

如何在rails的控制器操作中获取非活动记录模型引发异常

例子

  def template_type_test(revision)
    if revision == PHOTO_REV
      template_type = :photo_template
    elsif revision == TEXT_REV
      template_type = :text_template
    else
      raise 'Unexpected revision in template.  Use the template provided by Right-Photo.'
    end
  end

如何在控制器操作中获得此引发异常?

请分享你的想法?

4

0 回答 0