Eric Anderson wrote:> Is there anyway to do this or does
> Rails only support a single level of partials? I have verified that the
> second level of partials is executed but the "bar" variable does
not
> appear to be in the scope of that second level.
After looking at the partials code it doesn''t appear possible. I was 
thinking perhaps we could use Kernel.local_variables to pass all local 
variables into the partial automatically but figured that would polute 
the namespace too much. So instead I opted to change the the 
render_collection_of_partials to be more like render_partials. I put a 
optional argument on render_collection_of_partials which is a hash of 
local assigns. This allows me to put the following in the parent partial:
<%=render_collection_of_partials ''baz'', @more_recs, nil,
''bar'' => bar%>
This way bar is in scope. If I get some time today I will try to make a 
diff of it against the Rails "head" and create the unit testing for it
in case anybody wants the same functionality.
Eric
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails