Skip to content

Commit

Permalink
Use the new respond_to API for dealing with non-HTML accepts in rende…
Browse files Browse the repository at this point in the history
…r_404 and render_500
  • Loading branch information
jamis committed Mar 16, 2006
1 parent 93892e4 commit e8bb7f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/exception_notifiable.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ def local_request?
end end


def render_404 def render_404
render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" respond_to do |type|
type.html { render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" }
type.all { render :nothing => true, :status => "404 Not Found" }
end
end end


def render_500 def render_500
render :file => "#{RAILS_ROOT}/public/500.html", :status => "500 Error" respond_to do |type|
type.html { render :file => "#{RAILS_ROOT}/public/500.html", :status => "500 Error" }
type.all { render :nothing => true, :status => "500 Error" }
end
end end


def rescue_action_in_public(exception) def rescue_action_in_public(exception)
Expand Down

0 comments on commit e8bb7f7

Please sign in to comment.