Does it work if you move the content_for call out of the helper and into the Haml template?
Sean Santry wrote: > HI Guys, > > Problem in a nutshell: In an edge rails app with edge haml, using > content_for in a helper method fails to yield content to the layout. > Here's the relevant pastie: > > http://pastie.org/286887 > > > I've been using Haml for awhile now, but have never delved into its > implementation. Recently I was using it with a Rails 2.1.1 app but > needed to upgrade to Edge Rails for a few bug named_scope bug fixes. > Upgrading to edge Rails broke a few things in the view and I think > I've traced it to edge Haml's CaptureHelper#capture_with_haml. > > To trace the problem, I created a bare-bones edge rails app with a > layout that contains a 'yield :sidebar' and a helper method that uses > 'content_for(:sidebar)' to render a partial into the layout. I noticed > that if I explicitly set @content_for_sidebar, the output showed up > correctly. I then put the regular content_for call back in my template > and manually hacked CaptureHelper#content_for in my frozen edge rails > to explicitly call capture_without_haml (instead of capture) and once > again the output showed up correctly. > > So I'm pretty sure the problem is in the Haml implementation of > capture (or further down the callchain) but quickly got lost in Haml's > internals. > > Any ideas? > > - Sean > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/haml?hl=en -~----------~----~----~----~------~----~------~--~---
