ApplicationController にエラー処理メソッドがあります。
rescue_from ActiveRecord::RecordNotFound, :with => :not_found
def not_found(exception)
@exception = exception
render :template => '/errors/not_found', :status => 404
end
でRAILS_ROOT/app/views/errors/not_found.html.erb
、私はこれを持っています:
<h1>Error 404: Not Found</h1>
<%= debug @exception %>
しかし@exception
、常にnil
そこにあります。試してみましたがdebug assigns
、それは常に{}
です。呼び出し時に代入はコピーされませんrender :template
か? もしそうなら、どうすれば入手できますか?
私はエッジレールにいます。