Module: Ext::Forward::Base

Defined in:
lib/ext/forward.rb

Instance Method Summary collapse

Instance Method Details

#forward(controller, method = @method, *a) ⇒ Object

Forwards to another controller

  • controller : the other controller

  • method : the designed method, actual method if not specified

  • *args : method arguments

Raises:



86
87
88
89
90
91
92
93
94
95
# File 'lib/ext/forward.rb', line 86

def forward(controller, method=@method, *a)
  # method selector, :method=>'get' or 'post'

  if /NotFound$/ =~ controller.name # facility for NotFound controller
    a = [e['PATH_INFO']] if a.empty? or not a.first
    method = 'get'
  end

  raise Forwarder.new(controller, method, *a)
end