Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

`Digestor` can now parse old style hash syntax for `render`

  • Loading branch information...
commit 17f2499f04ff154ddd673f5522158fd01e9e054e 1 parent 21bad74
@christos christos authored
View
8 actionpack/lib/action_view/digestor.rb
@@ -15,10 +15,10 @@ class Digestor
# render(topics) => render("topics/topic")
# render(message.topics) => render("topics/topic")
RENDER_DEPENDENCY = /
- render\s* # render, followed by an optional space
- \(? # start a optional parenthesis for the render call
- (partial:)?\s* # naming the partial, used with collection -- 1st capture
- ([@a-z"'][@a-z_\/\."']+) # the template name itself -- 2nd capture
+ render\s* # render, followed by an optional space
+ \(? # start a optional parenthesis for the render call
+ (partial:|:partial\s+=>)?\s* # naming the partial, used with collection -- 1st capture
+ ([@a-z"'][@a-z_\/\."']+) # the template name itself -- 2nd capture
/x
cattr_accessor(:cache) { Hash.new }
View
1  actionpack/test/fixtures/digestor/messages/edit.html.erb
@@ -2,3 +2,4 @@
<%= render partial: "form" %>
<%= render @message %>
<%= render ( @message.events ) %>
+<%= render :partial => "comments/comment", :collection => @message.comments %>
View
6 actionpack/test/template/digestor_test.rb
@@ -116,6 +116,12 @@ def test_extra_whitespace_in_render_with_parenthesis
end
end
+ def test_old_style_hash_in_render_invocation
+ assert_digest_difference("messages/edit") do
+ change_template("comments/_comment")
+ end
+ end
+
private
def assert_logged(message)
log = StringIO.new
Please sign in to comment.
Something went wrong with that request. Please try again.