02 Apr '12, 12am

I'm back to ivars in controllers for the same reason as this comment: @leshill @myronmarston @avdi

As long as we're talking theory & coupling... From the perspective of the view, it has to 'know' a priori how the controller is providing data, either instance variables or expose'd methods etc. I've been changing some controllers over to using respond_to/respond_with ala episode 224 (http://railscasts.com/episodes/224-controllers-in-rails-3). The only stumbling block for me is that the view template still needs to know how the controller is providing data, even though the controller specified 'respond_with widgets' (or 'respond_with @widgets'). Non-templated requests, e.g. /widgets/index.xml, are picking up the correct data, but I don't see a clean way of determining in the view template (say index.html.haml) what the controller said to respond_with. The real pain point here is when I'm rendering partials. At the moment I'm having to call the partial with a :locals hash. ...

Full article: http://railscasts.com/episodes/259-decent-exposure?view=c...

Tweets

Episode #259 - March 30th, 2012

ruby5.envylabs.com 30 Mar '12, 7pm

March 27th, 2012 Factory 3.0 says bye to Ruby 1.8 and Rails 2, heroku_san ensures you do your deploys right, Bullet 2.3.0 ...

Today: How Can I Limit My Child’s Exposure To Advertising & Marketing?

Today: How Can I Limit My Child’s Exposure To A...

thegoodhuman.com 01 Apr '12, 4pm

Against this backdrop of media and marketing saturation, what can be done to help steer our kids in a more healthy directi...