江の島エンジニアのTips集

grape-tips

(2015/04/23)

grape-tips
rescue_from ActiveRecord::RecordNotFound do |e|
  error! e.message, 404
end

undefined method `error!’ for #

rescue_from ActiveRecord::RecordNotFound do |e|
  rack_response({error: e.message}.to_json, 404)
end

バージョンアップが必要

  • このエントリーをはてなブックマークに追加
  • follow us in feedly