Module: WillPaginate::Railtie::ShowExceptionsPatch

### Home Classes Methods

### In Files

- lib/will_paginate/railtie.rb

### Methods

- #status_code_with_paginate

### Class/Module Index

Quicksearch

- WillPaginate
- WillPaginate::ActionView
- WillPaginate::ActionView::LinkRenderer
- WillPaginate::ActiveRecord
- WillPaginate::ActiveRecord::BaseMethods
- WillPaginate::ActiveRecord::Pagination
- WillPaginate::ActiveRecord::RelationMethods
- WillPaginate::Collection
- WillPaginate::CollectionMethods
- WillPaginate::DataMapper
- WillPaginate::DataMapper::CollectionMethods
- WillPaginate::DataMapper::Pagination
- WillPaginate::Deprecation
- WillPaginate::Deprecation::Hash
- WillPaginate::I18n
- WillPaginate::InvalidPage
- WillPaginate::Merb
- WillPaginate::Merb::LinkRenderer
- WillPaginate::PageNumber
- WillPaginate::PerPage
- WillPaginate::PerPage::Inheritance
- WillPaginate::Railtie
- WillPaginate::Railtie::ControllerRescuePatch
- WillPaginate::Railtie::ShowExceptionsPatch
- WillPaginate::SequelMethods
- WillPaginate::Sinatra
- WillPaginate::Sinatra::Helpers
- WillPaginate::Sinatra::LinkRenderer
- WillPaginate::ViewHelpers
- WillPaginate::ViewHelpers::LinkRenderer
- WillPaginate::ViewHelpers::LinkRendererBase
- Array
- Object

No matching classes.

# WillPaginate::Railtie::ShowExceptionsPatch

Extending the exception handler middleware so it properly detects WillPaginate::InvalidPage regardless of it being a tag module.

### Public Instance Methods

status_code_with_paginate(exception = @exception) click to toggle source

    # File lib/will_paginate/railtie.rb, line 43
    def status_code_with_paginate(exception = @exception)
      if exception.is_a?(WillPaginate::InvalidPage) or
          (exception.respond_to?(:original_exception) &&
            exception.original_exception.is_a?(WillPaginate::InvalidPage))
        Rack::Utils.status_code(:not_found)
      else
        original_method = method(:status_code_without_paginate)
        if original_method.arity != 0
          original_method.call(exception)
        else
          original_method.call()
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.