Sha256: 61f93965aa1e42f01a9a47fa58a88c68213492942ca92a1c2b8179b0f2df5ecc

Contents?: true

Size: 600 Bytes

Versions: 13

Compression:

Stored size: 600 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery
  respond_to :html

  # NotFound errors will be redirected to the action not_found while any other will be redirected to the action generic.
  rescue_from ApiClient::Exceptions::NotFound, :with => :not_found
  rescue_from ApiClient::Exceptions::Generic, :with => :generic

  # This code is only for example purposes.
  # Any behavior can be executed here. Just write your own.
  def not_found
    ApplicationMailer.send_not_found_notice.deliver
  end

  def generic
    ApplicationMailer.send_generic_error.deliver
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
api-client-1.8.1 examples/controllers/application_controller.rb
api-client-1.8.0 examples/controllers/application_controller.rb
api-client-1.7.1 examples/controllers/application_controller.rb
api-client-1.7.0 examples/controllers/application_controller.rb
api-client-1.6.1 examples/controllers/application_controller.rb
api-client-1.6.0 examples/controllers/application_controller.rb
api-client-1.5.4 examples/controllers/application_controller.rb
api-client-1.5.3 examples/controllers/application_controller.rb
api-client-1.5.2 examples/controllers/application_controller.rb
api-client-1.5.1 examples/controllers/application_controller.rb
api-client-1.5.0 examples/controllers/application_controller.rb
api-client-1.4.1 examples/controllers/application_controller.rb
api-client-1.4.0 examples/controllers/application_controller.rb