Don’t forget: “render :layout => …” should appear below any variables in your controller.

I’ve spent a few hours trying to get the @variables set in my controller to show up in my layout. After much frustration and trying all kinds of fancy ways around my problem, it suddenly occurred to me that I was simply loading the layout before the variables; I was loading them in the wrong order! Grrr…..

If you are having problems with variables not loading properly, check the order you call the render. It might save you a headache and the need for as much Pepsi as I went through trying to figure this stupid thing out.

2 Responses to “Rails Controller Variables not Loading”

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code lang=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" extra="">