aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rwxr-xr-xactionpack/lib/action_controller/base.rb7
-rw-r--r--actionpack/lib/action_controller/layout.rb9
-rw-r--r--actionpack/lib/action_controller/test_process.rb7
-rw-r--r--actionpack/test/template/text_helper_test.rb2
4 files changed, 20 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 7f8ff5ed09..43f948e73d 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -224,6 +224,13 @@ module ActionController #:nodoc:
# FCGI.each_cgi{ |cgi| WeblogController.process_cgi(cgi) }
class Base
DEFAULT_RENDER_STATUS_CODE = "200 OK"
+
+ # Action Controller subclasses should be reloaded by the dispatcher in Rails
+ # when Dependencies.mechanism = :load.
+ def self.inherited(child) #:nodoc:
+ child.send :include, Reloadable
+ super
+ end
# Determines whether the view has access to controller internals @request, @response, @session, and @template.
# By default, it does.
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb
index cc153c45a7..f2a5b97bf1 100644
--- a/actionpack/lib/action_controller/layout.rb
+++ b/actionpack/lib/action_controller/layout.rb
@@ -1,16 +1,16 @@
module ActionController #:nodoc:
module Layout #:nodoc:
- def self.append_features(base)
- super
+ def self.included(base)
+ base.extend(ClassMethods)
base.class_eval do
alias_method :render_with_no_layout, :render
alias_method :render, :render_with_a_layout
class << self
alias_method :inherited_without_layout, :inherited
+ alias_method :inherited, :inherited_with_layout
end
end
- base.extend(ClassMethods)
end
# Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in
@@ -172,8 +172,9 @@ module ActionController #:nodoc:
end
private
- def inherited(child)
+ def inherited_with_layout(child)
inherited_without_layout(child)
+ child.send :include, Reloadable
layout_match = child.name.underscore.sub(/_controller$/, '')
child.layout(layout_match) unless layout_list.grep(%r{layouts/#{layout_match}\.[a-z][0-9a-z]*$}).empty?
end
diff --git a/actionpack/lib/action_controller/test_process.rb b/actionpack/lib/action_controller/test_process.rb
index 289ab3d5e7..caba4bfb39 100644
--- a/actionpack/lib/action_controller/test_process.rb
+++ b/actionpack/lib/action_controller/test_process.rb
@@ -333,6 +333,13 @@ module ActionController #:nodoc:
end
end
+ def build_request_uri(action, parameters)
+ options = @controller.send(:rewrite_options, parameters)
+ options.update(:only_path => true, :action => action)
+ url = ActionController::UrlRewriter.new(@request, parameters)
+ @request.set_REQUEST_URI(url.rewrite(options))
+ end
+
def session
@response.session
end
diff --git a/actionpack/test/template/text_helper_test.rb b/actionpack/test/template/text_helper_test.rb
index b323568068..d1ef946f29 100644
--- a/actionpack/test/template/text_helper_test.rb
+++ b/actionpack/test/template/text_helper_test.rb
@@ -3,7 +3,7 @@ require "#{File.dirname(__FILE__)}/../testing_sandbox"
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/text_helper'
require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/numeric' # for human_size
require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/hash' # for stringify_keys
-require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/object_and_class.rb' # for blank?
+require File.dirname(__FILE__) + '/../../../activesupport/lib/active_support/core_ext/object.rb' # for blank?
class TextHelperTest < Test::Unit::TestCase
include ActionView::Helpers::TextHelper