2009-04-27 21:21:26 -04:00
|
|
|
module ActionController
|
|
|
|
module Rails2Compatibility
|
2009-05-11 20:07:05 -04:00
|
|
|
extend ActiveSupport::DependencyModule
|
2009-04-27 21:21:26 -04:00
|
|
|
|
2009-05-01 20:27:44 -04:00
|
|
|
# Temporary hax
|
2009-05-11 20:07:05 -04:00
|
|
|
included do
|
2009-05-11 15:45:26 -04:00
|
|
|
::ActionController::UnknownAction = ::AbstractController::ActionNotFound
|
|
|
|
::ActionController::DoubleRenderError = ::AbstractController::DoubleRenderError
|
|
|
|
|
2009-05-01 20:27:44 -04:00
|
|
|
cattr_accessor :session_options
|
|
|
|
self.send(:class_variable_set, "@@session_options", {})
|
|
|
|
|
|
|
|
cattr_accessor :allow_concurrency
|
|
|
|
self.send(:class_variable_set, "@@allow_concurrency", false)
|
|
|
|
|
|
|
|
cattr_accessor :param_parsers
|
|
|
|
self.send(:class_variable_set, "@@param_parsers", { Mime::MULTIPART_FORM => :multipart_form,
|
|
|
|
Mime::URL_ENCODED_FORM => :url_encoded_form,
|
|
|
|
Mime::XML => :xml_simple,
|
|
|
|
Mime::JSON => :json })
|
|
|
|
|
|
|
|
cattr_accessor :relative_url_root
|
|
|
|
self.send(:class_variable_set, "@@relative_url_root", ENV['RAILS_RELATIVE_URL_ROOT'])
|
|
|
|
|
|
|
|
cattr_accessor :default_charset
|
|
|
|
self.send(:class_variable_set, "@@default_charset", "utf-8")
|
2009-05-11 17:48:58 -04:00
|
|
|
|
|
|
|
cattr_reader :protected_instance_variables
|
|
|
|
self.send(:class_variable_set, "@@protected_instance_variables", %w(@assigns @performed_redirect @performed_render @variables_added @request_origin @url @parent_controller
|
|
|
|
@action_name @before_filter_chain_aborted @action_cache_path @_headers @_params
|
|
|
|
@_flash @_response))
|
|
|
|
end
|
|
|
|
|
|
|
|
module ClassMethods
|
|
|
|
def protect_from_forgery() end
|
2009-05-11 20:07:05 -04:00
|
|
|
def consider_all_requests_local() end
|
|
|
|
def rescue_action(env)
|
|
|
|
raise env["action_dispatch.rescue.exception"]
|
|
|
|
end
|
2009-05-01 20:27:44 -04:00
|
|
|
end
|
|
|
|
|
2009-04-27 21:21:26 -04:00
|
|
|
def render_to_body(options)
|
|
|
|
if options.is_a?(Hash) && options.key?(:template)
|
|
|
|
options[:template].sub!(/^\//, '')
|
|
|
|
end
|
2009-05-11 15:04:43 -04:00
|
|
|
|
|
|
|
options[:text] = nil if options[:nothing] == true
|
|
|
|
|
2009-04-27 21:21:26 -04:00
|
|
|
super
|
|
|
|
end
|
2009-05-11 15:45:26 -04:00
|
|
|
|
|
|
|
def _layout_for_name(name)
|
|
|
|
name &&= name.sub(%r{^/?layouts/}, '')
|
|
|
|
super
|
|
|
|
end
|
2009-05-01 19:02:37 -04:00
|
|
|
|
2009-04-27 21:21:26 -04:00
|
|
|
end
|
|
|
|
end
|