diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-16 14:13:42 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-16 14:50:51 -0300 |
commit | 9830ebbeaf6f7faead9b4503ed9c9ab0a327df9a (patch) | |
tree | e3d6f75c2f62eb96b023980092c3deafe3ddccd1 /actionview/lib/action_view/renderer | |
parent | 1f5b360466c3494267cc9aad08a19d1ace4763d8 (diff) | |
download | rails-9830ebbeaf6f7faead9b4503ed9c9ab0a327df9a.tar.gz rails-9830ebbeaf6f7faead9b4503ed9c9ab0a327df9a.tar.bz2 rails-9830ebbeaf6f7faead9b4503ed9c9ab0a327df9a.zip |
No need to have a file to PartialIteration class
This class is only used on the PartialRenderer.
Diffstat (limited to 'actionview/lib/action_view/renderer')
-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 |