[LRUG] Funny gotcha with blocks in partials.

Chris Mear chris at feedmechocolate.com
Mon Jun 22 09:16:58 PDT 2009


2009/6/22 Tim Cowlishaw <tim at timcowlishaw.co.uk>

>
> On 22 Jun 2009, at 17:08, Chris Mear wrote:
>
>>
>> Yeah, I've done something like this before, by building up the output
>> using the concat method, and using capture to get the rendered results of
>> blocks defined in the ERB template. Something like this should work:
>>
> [snip...]
>
> Aah yep - that looks good! However, am i right in thinking that that would
> break if i pass a regular ruby block to it, rather than a block containing
> an erb template fragment?


Yes, I think capture would just return nil or an empty string.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20090622/c8ad4879/attachment.html>


More information about the Chat mailing list