aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/inline_template.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/inline_template.rb')
-rw-r--r--actionpack/lib/action_view/inline_template.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/inline_template.rb b/actionpack/lib/action_view/inline_template.rb
index 49147901a1..fb5e4408db 100644
--- a/actionpack/lib/action_view/inline_template.rb
+++ b/actionpack/lib/action_view/inline_template.rb
@@ -2,6 +2,10 @@ module ActionView #:nodoc:
class InlineTemplate #:nodoc:
include Renderable
+ # Count the number of inline templates
+ cattr_accessor :inline_template_count
+ @@inline_template_count = 0
+
def initialize(view, source, locals = {}, type = nil)
@view = view
@@ -12,5 +16,11 @@ module ActionView #:nodoc:
@method_key = @source
@handler = Template.handler_class_for_extension(@extension).new(@view)
end
+
+ private
+ # FIXME: Modifying this shared variable may not thread safe
+ def method_name_path_segment
+ "inline_#{@@inline_template_count += 1}"
+ end
end
end