evanwalsh (owner)

Revisions

gist: 34588 Download_button fork
public
Public Clone URL: git://gist.github.com/34588.git
Embed All Files: show embed
rescue_404.rb #
1
2
3
4
5
6
7
8
9
10
11
12
# Put this in routes.rb at the very bottom (right before end)
 
map.error '*path', :controller => 'application', :action => 'rescue_404'
 
# Put this in application.rb
 
rescue_from ActiveRecord::RecordNotFound, ActionController::UnknownAction, :with => :rescue_404
 
def rescue_404
  render :template => "errors/404", :layout => "application", :status => "404"
end