1

I have a template with 2 partials. In the first one, I am yieleding content which is only defined in the second partial (with a content_for tag). The problem is that the yield does not recognize that content yet since it was not defined.

If I reverse the order of the partials the yield recognized the content, yet the layout is not as I desire obviously...

Is there a way to do this? Thank you.

ShayDavidson
  • 717
  • 1
  • 7
  • 20
  • Is this something more than having the first partial pass `:locals` when it invokes the other? See http://stackoverflow.com/questions/4402556/rails-confused-about-syntax-for-passing-locals-to-partials -- the accepted answer has a great summary. – Tom Harrison Mar 19 '12 at 16:45
  • didn't find any answer to this in the link, and also couldn't figure out what you suggested :P – ShayDavidson Mar 20 '12 at 07:52

1 Answers1

1

Okay, this was actually an easy fix. I moved the second partial into a content_for block placed above the first partial, and then just yielded it instead of declaring it as a partial.

ShayDavidson
  • 717
  • 1
  • 7
  • 20