Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 3900

Show
Ignore:
Timestamp:
03/16/06 17:48:31 (3 years ago)
Author:
minam
Message:

Use the new respond_to API for dealing with non-HTML accepts in render_404 and render_500

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/exception_notification/lib/exception_notifiable.rb

    r3570 r3900  
    5555 
    5656  def render_404 
    57     render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" 
     57    respond_to do |type| 
     58      type.html { render :file => "#{RAILS_ROOT}/public/404.html", :status => "404 Not Found" } 
     59      type.all  { render :nothing => true, :status => "404 Not Found" } 
     60    end 
    5861  end 
    5962 
    6063  def render_500 
    61     render :file => "#{RAILS_ROOT}/public/500.html", :status => "500 Error" 
     64    respond_to do |type| 
     65      type.html { render :file => "#{RAILS_ROOT}/public/500.html", :status => "500 Error" } 
     66      type.all  { render :nothing => true, :status => "500 Error" } 
     67    end 
    6268  end 
    6369