Ruby on Rails Friday, March 3, 2017

On Fri, Mar 3, 2017 at 2:39 PM, Joe Guerra <> wrote:
> Would it be ok to like set the instant variable
> to a global and use that?

Not if that value is going to be different for different users...

> I tried that, and it seems to have worked. I not sure if it's the best
> practice though.

It's not.

Write a separate method that creates the instance variable and use
a before_filter to set it in the methods that need it.

Hassan Schroeder ------------------------
twitter: @hassan
Consulting Availability : Silicon Valley or remote

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment