Problem with url_for

Hey everyone,

I have an Asset class that extends AR::Base, and a series of subclasses of Asset (Stylesheet, Layout, etc.)

I have REST routes set up with assets nested under sites.

when doing something like url_for([@site, @asset]), if @asset is a Stylesheet, I'll get an undefined method 'site_stylesheet_path', where what I really need is site_asset_path. I've patched Rails locally to fix this, but before I formally submit a patch for this I'd like to hear your thoughts on this.

Thanks,
Brennan

That is what I would expect. I certainly wouldn’t expect that it tries site_asset_path for a Stylesheet object.

However, if site_stylesheet_path isn’t specified, Rails could be patched to lookup site_xxx_path trying Stylesheet ancestors one-by-one. That could be a hog, though.