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か? もしそうなら、どうすれば入手できますか?
私はエッジレールにいます。