mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
19 lines
416 B
Ruby
19 lines
416 B
Ruby
module ActionView
|
|
# NOTE: The template that this mixin is being included into is frozen
|
|
# so you cannot set or modify any instance variables
|
|
module RenderablePartial #:nodoc:
|
|
extend ActiveSupport::Memoizable
|
|
|
|
def variable_name
|
|
name.sub(/\A_/, '').to_sym
|
|
end
|
|
memoize :variable_name
|
|
|
|
def counter_name
|
|
"#{variable_name}_counter".to_sym
|
|
end
|
|
memoize :counter_name
|
|
|
|
end
|
|
end
|