| 43 | | case options |
|---|
| 44 | | when %r{^\w+://.*} |
|---|
| 45 | | rubricks_redirect_to_original(options) |
|---|
| 46 | | when String |
|---|
| 47 | | redirect_to(RubricksLib.base_url + options) |
|---|
| 48 | | when :back |
|---|
| 49 | | request.env["HTTP_REFERER"] ? redirect_to(request.env["HTTP_REFERER"]) : raise(RedirectBackError) |
|---|
| 50 | | when Hash |
|---|
| 51 | | if parameters_for_method_reference.empty? |
|---|
| 52 | | redirect_to(url_for(options)) |
|---|
| | 43 | if ajax? |
|---|
| | 44 | raise RubricksError::Common::AjaxError, '"redirect_to" needs hash-style url_options when used at AJAX request.' unless options.is_a?(Hash) |
|---|
| | 45 | controller = options[:controller] || params[:controller] |
|---|
| | 46 | action = options[:action] |
|---|
| | 47 | parameters = (options.delete(:params) || {}).merge(options) |
|---|
| | 48 | render :inline => simple_render_component(controller, action, parameters) |
|---|
| | 49 | else |
|---|
| | 50 | case options |
|---|
| | 51 | when %r{^\w+://.*} |
|---|
| | 52 | rubricks_redirect_to_original(options) |
|---|
| | 53 | when String |
|---|
| | 54 | redirect_to(RubricksLib.base_url + options) |
|---|
| | 55 | when :back |
|---|
| | 56 | request.env["HTTP_REFERER"] ? redirect_to(request.env["HTTP_REFERER"]) : raise(RedirectBackError) |
|---|
| | 57 | when Hash |
|---|
| | 58 | if parameters_for_method_reference.empty? |
|---|
| | 59 | redirect_to(url_for(options)) |
|---|
| | 60 | else |
|---|
| | 61 | redirect_to(url_for(options, *parameters_for_method_reference)) |
|---|
| | 62 | end |
|---|
| 54 | | redirect_to(url_for(options, *parameters_for_method_reference)) |
|---|
| 55 | | end |
|---|
| 56 | | else |
|---|
| 57 | | if parameters_for_method_reference.empty? |
|---|
| 58 | | redirect_to(url_for(options)) |
|---|
| 59 | | response.redirected_to = options |
|---|
| 60 | | else |
|---|
| 61 | | redirect_to(url_for(options, *parameters_for_method_reference)) |
|---|
| 62 | | response.redirected_to, response.redirected_to_method_params = options, parameters_for_method_reference |
|---|
| | 64 | if parameters_for_method_reference.empty? |
|---|
| | 65 | redirect_to(url_for(options)) |
|---|
| | 66 | response.redirected_to = options |
|---|
| | 67 | else |
|---|
| | 68 | redirect_to(url_for(options, *parameters_for_method_reference)) |
|---|
| | 69 | response.redirected_to, response.redirected_to_method_params = options, parameters_for_method_reference |
|---|
| | 70 | end |
|---|