Module: Racket::Helpers::Routing

Defined in:
lib/racket/helpers/routing.rb

Overview

Helper module that handles routing

Instance Method Summary collapse

Instance Method Details

#route(controller, action = nil, *params) ⇒ String Also known as: r

Returns a route to an action within another controller.

Parameters:

  • controller (Class)
  • action (Symbol) (defaults to: nil)
  • params (Array)

Returns:

  • (String)


30
31
32
# File 'lib/racket/helpers/routing.rb', line 30

def route(controller, action = nil, *params)
  controller.get_route(action, params)
end

#route_self(action = nil, *params) ⇒ String Also known as: rs

Returns a route to an action within the current controller.

Parameters:

  • action (Symbol) (defaults to: nil)
  • params (Array)

Returns:

  • (String)


41
42
43
# File 'lib/racket/helpers/routing.rb', line 41

def route_self(action = nil, *params)
  self.class.get_route(action, params)
end