Displaying 2 results from an estimated 2 matches for "tmeplate".
Did you mean:
template
2008 May 12
8
Complex data structures in templates
Hi.
I wonder if it is possible to use more complex data structures in
templates than simple variables and arrays? I have been trying nested
arrays, as well as nested arrays and hashes, but nothing seems to work
(more specifically, nested arrays seem to be flattened into a single
array). Having only simple variables and arrays is a little limiting.
Something like the Perl-based Template Toolkit
2006 Feb 25
2
How do templates get access to controller variables?
...variables are being made
accessible to the ERb code in the views.
In the Agile Rails book on pages 38, there''s a sidebar at the top that
hints at what''s going on:
"Rails does some Ruby magic so that the instance variables of the
controller object are injected into the tmeplate object".
and then on the next page, this sentence appears as part of the "story
so far":
5. Rails processes this template through ERb... substituting in values
set up by the controller.
I''m really interested in learning what Ruby language features made this
cool stu...