RailsCasts Pro episodes are now free!

Learn more or hide this

Philip Hallstrom's Profile

GitHub User: phallstrom

Site: http://www.pjkh.com

Comments by Philip Hallstrom


It looks like I might be the only one, but for some reason I don't like this at all. I've always liked instance variables in the view because the @ makes it very clear where the data is coming from -- the controller. Everything else is either local or a helper method. This makes that much harder to see at a glance.

The other issue is what happens if on an article page you decide to have a "related articles" list and do a loop like:

<% for article in related_articles %>

What happens with 'article' in this case after the loop completes? Seems messy. Yes, I could change 'article' to 'a' or something, but the chance for collision bothers me. Even having to remember that in this case article is not from the controller, but a local variable bother me...

+2 cents.