• 01
  • Jul, 08

Rails Controller Variables not Loading

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.

Share and Enjoy:
  • Digg
  • Reddit
  • del.icio.us
  • Facebook
  • StumbleUpon
  • Technorati
  • TwitThis
  • E-mail this story to a friend!

One Response

  1. Hey Jas! Thanks for leaving a comment on my blog! I didn’t know you had a site! Good to hear from you! Hope all is well with you and your fam!

Leave a Reply

Car Humor | U2 News