diff options
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/lib/action_view/digestor.rb | 3 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/form_options_helper.rb | 6 | ||||
-rw-r--r-- | actionview/lib/action_view/layouts.rb | 5 | ||||
-rw-r--r-- | actionview/test/activerecord/controller_runtime_test.rb | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb index 9c18ec56ca..cadef22022 100644 --- a/actionview/lib/action_view/digestor.rb +++ b/actionview/lib/action_view/digestor.rb @@ -41,8 +41,7 @@ module ActionView options = {} options[:formats] = [finder.rendered_format] if finder.rendered_format - if finder.disable_cache { finder.exists?(logical_name, [], partial, [], options) } - template = finder.disable_cache { finder.find(logical_name, [], partial, [], options) } + if template = finder.disable_cache { finder.find_all(logical_name, [], partial, [], options).first } finder.rendered_format ||= template.formats.first if node = seen[template.identifier] # handle cycles in the tree diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index 06b696f281..0cd3207b12 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -651,12 +651,12 @@ module ActionView # The HTML specification says when nothing is select on a collection of radio buttons # web browsers do not send any value to server. # Unfortunately this introduces a gotcha: - # if a +User+ model has a +category_id+ field, and in the form none category is selected no +category_id+ parameter is sent. So, - # any strong parameters idiom like + # if a +User+ model has a +category_id+ field and in the form no category is selected, no +category_id+ parameter is sent. So, + # any strong parameters idiom like: # # params.require(:user).permit(...) # - # will raise an error since no +{user: ...}+ will be present. + # will raise an error since no <tt>{user: ...}</tt> will be present. # # To prevent this the helper generates an auxiliary hidden field before # every collection of radio buttons. The hidden field has the same name as collection radio button and blank value. diff --git a/actionview/lib/action_view/layouts.rb b/actionview/lib/action_view/layouts.rb index a74a5e05f3..8db1674187 100644 --- a/actionview/lib/action_view/layouts.rb +++ b/actionview/lib/action_view/layouts.rb @@ -248,11 +248,14 @@ module ActionView # # If the specified layout is a: # String:: the String is the template name - # Symbol:: call the method specified by the symbol, which will return the template name + # Symbol:: call the method specified by the symbol + # Proc:: call the passed Proc # false:: There is no layout # true:: raise an ArgumentError # nil:: Force default layout behavior with inheritance # + # Return value of Proc & Symbol arguments should be String, false, true or nil + # with the same meaning as described above. # ==== Parameters # * <tt>layout</tt> - The layout to use. # diff --git a/actionview/test/activerecord/controller_runtime_test.rb b/actionview/test/activerecord/controller_runtime_test.rb index af91348d76..a61181df88 100644 --- a/actionview/test/activerecord/controller_runtime_test.rb +++ b/actionview/test/activerecord/controller_runtime_test.rb @@ -38,8 +38,8 @@ class ControllerRuntimeLogSubscriberTest < ActionController::TestCase tests LogSubscriberController def setup - super @old_logger = ActionController::Base.logger + super ActionController::LogSubscriber.attach_to :action_controller end |