Rails Instance Variables In Your Views/Partials

Posted by Weston Ganger

This can come in real handy when using shared partials such as a sidebar. Just place this in your view/partial

<% @posts ||= Post.all %>

Article Topic:Software Development - Rails

Date:July 04, 2014

Recommended Posts



Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected