aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/fixtures/actionpack
diff options
context:
space:
mode:
authorJoel Junström <joel.junstrom@oktavilla.se>2012-09-16 22:45:08 +0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-07-16 14:50:51 -0300
commit1f5b360466c3494267cc9aad08a19d1ace4763d8 (patch)
tree508bab4cf441376b1fac76ebe75e46fd6fee233b /actionview/test/fixtures/actionpack
parent6947e3a2b57b62e1d6bd24082faa125973bbc388 (diff)
downloadrails-1f5b360466c3494267cc9aad08a19d1ace4763d8.tar.gz
rails-1f5b360466c3494267cc9aad08a19d1ace4763d8.tar.bz2
rails-1f5b360466c3494267cc9aad08a19d1ace4763d8.zip
Added PartialIteration class used when rendering collections
The iteration object is available as the local variable "template_name_iteration" when rendering partials with collections. It gives access to the +size+ of the collection beeing iterated over, the current +index+ and two convinicence methods +first?+ and +last?+ "template_name_counter" variable is kept but is deprecated. [Joel Junström + Lucas Uyezu]
Diffstat (limited to 'actionview/test/fixtures/actionpack')
-rw-r--r--actionview/test/fixtures/actionpack/test/_customer_iteration.erb1
-rw-r--r--actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb1
2 files changed, 2 insertions, 0 deletions
diff --git a/actionview/test/fixtures/actionpack/test/_customer_iteration.erb b/actionview/test/fixtures/actionpack/test/_customer_iteration.erb
new file mode 100644
index 0000000000..fb530b04a7
--- /dev/null
+++ b/actionview/test/fixtures/actionpack/test/_customer_iteration.erb
@@ -0,0 +1 @@
+<%= customer_iteration_iteration.size %>-<%= customer_iteration_iteration.index %>: <%= customer_iteration.name %><%= '-first' if customer_iteration_iteration.first? %><%= '-last' if customer_iteration_iteration.last? %> \ No newline at end of file
diff --git a/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb b/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb
new file mode 100644
index 0000000000..57297d0564
--- /dev/null
+++ b/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb
@@ -0,0 +1 @@
+<%= client_iteration.size %>-<%= client_iteration.index %>: <%= client.name %><%= '-first' if client_iteration.first? %><%= '-last' if client_iteration.last? %> \ No newline at end of file