diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-17 20:14:12 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-17 20:14:12 -0700 |
commit | adc7097dc0d32e68cc613ca136ff3ec06301680c (patch) | |
tree | dd194901af31ee20e1202cac13fa67bc07683b5f | |
parent | fcbde454f673a2b393942b09f855a4febcf331fa (diff) | |
parent | d4f46269404587f8a2be9132c5cf91e2848da7f0 (diff) | |
download | rails-adc7097dc0d32e68cc613ca136ff3ec06301680c.tar.gz rails-adc7097dc0d32e68cc613ca136ff3ec06301680c.tar.bz2 rails-adc7097dc0d32e68cc613ca136ff3ec06301680c.zip |
Merge pull request #2124 from arunagw/render_partial_invalid_check_fix
Checking with to_s. As regexp fail with 1.8.7
-rw-r--r-- | actionpack/lib/action_view/renderer/partial_renderer.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/renderer/partial_renderer.rb b/actionpack/lib/action_view/renderer/partial_renderer.rb index e31712eb73..24df3af0e4 100644 --- a/actionpack/lib/action_view/renderer/partial_renderer.rb +++ b/actionpack/lib/action_view/renderer/partial_renderer.rb @@ -300,8 +300,7 @@ module ActionView else paths.map! { |path| retrieve_variable(path).unshift(path) } end - - if String === partial && @variable !~ /^[a-z_][a-zA-Z_0-9]*$/ + if String === partial && @variable.to_s !~ /^[a-z_][a-zA-Z_0-9]*$/ raise ArgumentError.new("The partial name (#{partial}) is not a valid Ruby identifier; " + "make sure your partial name starts with a letter or underscore, " + "and is followed by any combinations of letters, numbers, or underscores.") |