Module: Utopia::Controller::Actions

Defined in:
lib/utopia/controller/actions.rb

Overview

A controller layer which invokes functinality based on the request path.

Examples:

on '*' do |request, path|
	succeed! content: 'Hello World'
end

Defined Under Namespace

Modules: ClassMethods Classes: Action

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



16
17
18
# File 'lib/utopia/controller/actions.rb', line 16

def self.prepended(base)
	base.extend(ClassMethods)
end

Instance Method Details

#process!(request, path) ⇒ Object

Invoke all matching actions. If no actions match, will call otherwise. If no action gives a response, the request is passed to super.



148
149
150
151
152
# File 'lib/utopia/controller/actions.rb', line 148

def process!(request, path)
	catch_response do
		self.class.dispatch(self, request, path)
	end || super
end