aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/digestor.rb3
-rw-r--r--actionview/lib/action_view/helpers/tag_helper.rb13
-rw-r--r--actionview/lib/action_view/layouts.rb5
3 files changed, 14 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/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb
index 0633cfc2b4..4ba37fd5e5 100644
--- a/actionview/lib/action_view/helpers/tag_helper.rb
+++ b/actionview/lib/action_view/helpers/tag_helper.rb
@@ -115,6 +115,7 @@ module ActionView
# Returns an HTML tag.
#
# === Building HTML tags
+ #
# Builds HTML5 compliant tags with a tag proxy. Every tag can be built with:
#
# tag.<tag name>(optional content, options)
@@ -122,6 +123,7 @@ module ActionView
# where tag name can be e.g. br, div, section, article, or any tag really.
#
# ==== Passing content
+ #
# Tags can pass content to embed within it:
#
# tag.h1 'All titles fit to print' # => <h1>All titles fit to print</h1>
@@ -136,6 +138,7 @@ module ActionView
# # => <p>The next great American novel starts here.</p>
#
# ==== Options
+ #
# Any passed options become attributes on the generated tag.
#
# tag.section class: %w( kitties puppies )
@@ -177,7 +180,7 @@ module ActionView
# # => <img src="open & shut.png">
#
# The tag builder respects
- # [HTML5 void elements](https://www.w3.org/TR/html5/syntax.html#void-elements)
+ # {HTML5 void elements}[https://www.w3.org/TR/html5/syntax.html#void-elements]
# if no content is passed, and omits closing tags for those elements.
#
# # A standard element:
@@ -187,18 +190,19 @@ module ActionView
# tag.br # => <br>
#
# === Legacy syntax
+ #
# The following format is for legacy syntax support. It will be deprecated in future versions of Rails.
#
- # tag(tag_name, options)
+ # tag(name, options = nil, open = false, escape = true)
#
- # === Building HTML tags
- # Returns an empty HTML tag of type +name+ which by default is XHTML
+ # It returns an empty HTML tag of type +name+ which by default is XHTML
# compliant. Set +open+ to true to create an open tag compatible
# with HTML 4.0 and below. Add HTML attributes by passing an attributes
# hash to +options+. Set +escape+ to false to disable attribute value
# escaping.
#
# ==== Options
+ #
# You can use symbols or strings for the attribute names.
#
# Use +true+ with boolean attributes that can render with no value, like
@@ -208,6 +212,7 @@ module ActionView
# pointing to a hash of sub-attributes.
#
# ==== Examples
+ #
# tag("br")
# # => <br />
#
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.
#