aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/renderer/partial_renderer.rb
diff options
context:
space:
mode:
authorAkira Matsuda <ronnie@dio.jp>2015-02-06 00:18:05 +0900
committerAkira Matsuda <ronnie@dio.jp>2015-02-06 01:46:59 +0900
commitda9038eaa5d19c77c734a044c6b35d7bfac01104 (patch)
treeeaf9110c8d5dce1ad019b4038760eba67ed67185 /actionview/lib/action_view/renderer/partial_renderer.rb
parent4ca1dda0bfc9ba76c5da114ab47399a385ab059e (diff)
downloadrails-da9038eaa5d19c77c734a044c6b35d7bfac01104.tar.gz
rails-da9038eaa5d19c77c734a044c6b35d7bfac01104.tar.bz2
rails-da9038eaa5d19c77c734a044c6b35d7bfac01104.zip
Partial template name does no more have to be a valid Ruby identifier
because the partial renderer would not create an lvar per each template since c67005f221f102fe2caca231027d9b11cf630484
Diffstat (limited to 'actionview/lib/action_view/renderer/partial_renderer.rb')
-rw-r--r--actionview/lib/action_view/renderer/partial_renderer.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb
index 6c3015180a..5ff15411cf 100644
--- a/actionview/lib/action_view/renderer/partial_renderer.rb
+++ b/actionview/lib/action_view/renderer/partial_renderer.rb
@@ -519,7 +519,7 @@ module ActionView
def retrieve_variable(path, as)
variable = as || begin
base = path[-1] == "/" ? "" : File.basename(path)
- raise_invalid_identifier(path) unless base =~ /\A_?([a-z]\w*)(\.\w+)*\z/
+ raise_invalid_identifier(path) unless base =~ /\A_?(.*)(?:\.\w+)*\z/
$1.to_sym
end
if @collection
@@ -530,8 +530,7 @@ module ActionView
end
IDENTIFIER_ERROR_MESSAGE = "The partial name (%s) is not a valid Ruby identifier; " +
- "make sure your partial name starts with underscore, " +
- "and is followed by any combination of letters, numbers and underscores."
+ "make sure your partial name starts with underscore."
OPTION_AS_ERROR_MESSAGE = "The value (%s) of the option `as` is not a valid Ruby identifier; " +
"make sure it starts with lowercase letter, " +