Monday, May 19, 2008

Declarative Class Method Prettiness for ActionHelper

I don't know why it didn't occur to me sooner, but the most Rails-consistent way for ActionHelper to support a controller declaring action-specific helper modules is pretty obviously extending the existing ActionController::Helpers#helper method to accept an options hash supporting :only and :except, the same way the filter class methods do.

It may not be the coolest way to do it, but it's definitely the least surprising.

So ActionHelper now supports :only and will likely support :except sometime soon. (Though except seems much less likely to be useful.)

No comments: