Class: Wallaby::ApplicationController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/wallaby/application_controller.rb

Overview

Wallaby’s application controller It defaults to inherit from ::ApplicationController, which can be configured via ‘Wallaby.configuration.base_controller` It only contains the error handling logics

Direct Known Subclasses

SecureController

Constant Summary collapse

ERROR_PATH =
ERROR_LAYOUT = 'wallaby/error'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configurationWallaby::Configuration

Returns global configuration.

Returns:



42
43
44
# File 'app/controllers/wallaby/application_controller.rb', line 42

def self.configuration
  ::Wallaby.configuration
end

Instance Method Details

#bad_request(exception = nil) ⇒ Object

Bad request page

Parameters:

  • exception (Exception) (defaults to: nil)


31
32
33
# File 'app/controllers/wallaby/application_controller.rb', line 31

def bad_request(exception = nil)
  error_rendering(exception, __callee__)
end

#configurationWallaby::Configuration

Returns global configuration.

Returns:



47
48
49
# File 'app/controllers/wallaby/application_controller.rb', line 47

def configuration
  self.class.configuration
end

#healthyObject

Health check page



19
20
21
# File 'app/controllers/wallaby/application_controller.rb', line 19

def healthy
  render plain: 'healthy'
end

#not_found(exception = nil) ⇒ Object

Not found page

Parameters:

  • exception (Exception) (defaults to: nil)


25
26
27
# File 'app/controllers/wallaby/application_controller.rb', line 25

def not_found(exception = nil)
  error_rendering(exception, __callee__)
end

#unprocessable_entity(exception = nil) ⇒ Object

Unprocessable entity page

Parameters:

  • exception (Exception) (defaults to: nil)


37
38
39
# File 'app/controllers/wallaby/application_controller.rb', line 37

def unprocessable_entity(exception = nil)
  error_rendering(exception, __callee__)
end