Sha256: 5f838166c2b7254fe797fb3313708188fb20d39da24a42d4cf83052f15d0fe34
Contents?: true
Size: 807 Bytes
Versions: 8
Compression:
Stored size: 807 Bytes
Contents
# Internally redirects a request to another controller. This is used by the # abstract_actions module. module Adva module Controller module InternalRedirect def internal_redirect_to(target, params = nil) action, controller = target.split('#').reverse controller ||= controller_path params ||= self.params params.merge!(:controller => controller, :action => action) params = yield(params) if block_given? rack_endpoint = "#{controller}_controller".classify.constantize.action(action) env['action_dispatch.request.parameters'] = params response = rack_endpoint.call(env) self.status, self.headers, self.response_body = response @_response.headers.replace(response[1]) response end end end end
Version data entries
8 entries across 8 versions & 1 rubygems