diff options
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/renderer/partial_renderer.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb index 3963a73204..6b3c49aa79 100644 --- a/actionview/lib/action_view/renderer/partial_renderer.rb +++ b/actionview/lib/action_view/renderer/partial_renderer.rb @@ -1,7 +1,23 @@ require 'thread_safe' -require "action_view/partial_iteration" module ActionView + class PartialIteration # :nodoc: + attr_reader :size, :index + + def initialize(size, index) + @size = size + @index = index + end + + def first? + index == 0 + end + + def last? + index == size - 1 + end + end + # = Action View Partials # # There's also a convenience method for rendering sub templates within the current controller that depends on a |