Ruby

How to use optional locals with a Rails partial

When you call a partial in Rails, you pass through all of the local parameters.

But how do you use an “optional” local – or add a new local without having to go back and add it to all the other views.

> show\_closed = true unless defined?(show\_closed)

Leave a Reply