Sha256: 9eac7e8cdbcdc96469b1685ad1aee6129210c001bba7947ab47fba2e6e855108

Contents?: true

Size: 465 Bytes

Versions: 6

Compression:

Stored size: 465 Bytes

Contents

class Exceptions < Application

  attr_reader :handler 
  
  # handle NotFound exceptions (404)
  
   def not_found
     @handler = :not_found
     render :format => :html
   end
 
   # handle NotAcceptable exceptions (406)
   
   def not_acceptable
     @handler = :not_acceptable
     render "Handled by: not_acceptable"
   end
 
  # # Any client error (400 series)
  def client_error
    @handler = :client_error
    render "Handled by: client_error"
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
merb-core-0.9.4 spec/private/dispatch/fixture/app/controllers/exceptions.rb
merb-core-0.9.5 spec/private/dispatch/fixture/app/controllers/exceptions.rb
merb-core-0.9.6 spec/private/dispatch/fixture/app/controllers/exceptions.rb
merb-core-0.9.7 spec/private/dispatch/fixture/app/controllers/exceptions.rb
merb-helpers-0.9.8 spec/fixture/app/controllers/exceptions.rb
merb-helpers-0.9.9 spec/fixture/app/controllers/exceptions.rb