aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorChristos Zisopoulos <christos@me.com>2012-08-30 13:13:47 +0200
committerChristos Zisopoulos <christos@me.com>2012-08-30 13:13:47 +0200
commit17f2499f04ff154ddd673f5522158fd01e9e054e (patch)
tree96c557c050f0eed1e234afde7625ddaa5b96a9e5 /actionpack
parent21bad7445b26f62992b494804b29b74c9769e87d (diff)
downloadrails-17f2499f04ff154ddd673f5522158fd01e9e054e.tar.gz
rails-17f2499f04ff154ddd673f5522158fd01e9e054e.tar.bz2
rails-17f2499f04ff154ddd673f5522158fd01e9e054e.zip
`Digestor` can now parse old style hash syntax for `render`
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/digestor.rb8
-rw-r--r--actionpack/test/fixtures/digestor/messages/edit.html.erb1
-rw-r--r--actionpack/test/template/digestor_test.rb6
3 files changed, 11 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/digestor.rb b/actionpack/lib/action_view/digestor.rb
index 58920e1e59..01074c0687 100644
--- a/actionpack/lib/action_view/digestor.rb
+++ b/actionpack/lib/action_view/digestor.rb
@@ -15,10 +15,10 @@ module ActionView
# 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 }
diff --git a/actionpack/test/fixtures/digestor/messages/edit.html.erb b/actionpack/test/fixtures/digestor/messages/edit.html.erb
index 791654ffc9..a9e0a88e32 100644
--- a/actionpack/test/fixtures/digestor/messages/edit.html.erb
+++ b/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 %>
diff --git a/actionpack/test/template/digestor_test.rb b/actionpack/test/template/digestor_test.rb
index dd9bfbca05..a53e335bb3 100644
--- a/actionpack/test/template/digestor_test.rb
+++ b/actionpack/test/template/digestor_test.rb
@@ -116,6 +116,12 @@ class TemplateDigestorTest < ActionView::TestCase
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