You have to put this in application controller:
rescue_from ActiveRecord::RecordNotFound do |exception|
render_error 404
end
def render_error(status)
respond_to do |format|
format.html { render 'error_' + status.to_s() + '.html', :status => status, :layout => 'errors'}
format.all { render :nothing => true, :status => status }
end
end
Actually your ErrorController will be triggered by routes, but you have to add logic for exceptions.