On 6/11/07, DHH <[EMAIL PROTECTED]> wrote: > It's not really about url_for, it's about the delegation that goes > through it. None of this is to enrich url_for for public consumption.
Okay, I understand and agree with that. I haven't come across any spots where the framework "delegates through" url_for as we're describing. I can only find form_for() that delegates through polymorphic_path(). Would you consider a patch which removed this behavior (as un-needed) from url_for? > > First of all, I hate contrived examples. You can make a contrived > example prove anything. I'm really only interested in discussion real > code. Despite that, I still think that declaration is fine. I hate them too - but I'm not in a position to show any real code so I tried to put something together that reflected the ratios in my own code. > > First of all, routes.rb shouldn't reflect the size of the underlying > code base. It's about reflecting the resources exposed. Damages are > exposed as 4 different base resources, walls for example only as one. > Thus, it's fair for damages to take up more configuration space. I definitely agree that it's fair for damages to take up more configuration space - that's actually my point. > But if you have a suggestion for an API that wraps this cleaner, but > doesn't change the underlying generated routes, by all means shoot. I'm not complaining that I have a way to make configuration easier or that routes.rb is not clean enough. What I'm complaining about *is* the underlying routes (spec. their names). In the example, I'm complaining about house_ - as in house_walls_path, house_windows_path, house_doors_path. In my controllers and templates I type that stuff out *so* much more often than *damage_path yet :damages is the only route that actually needs disambiguation. And I spend a lot less time configuring my routes.rb than I do coding controllers and templates so any routes.rb syntactic sugar like auto-name_prefix actually generates (and of course, maybe just for me) syntactic vinegar elsewhere. I either have to explicitly switch it off with name_prefix => nil for every route not needing disambiguation or I have to refer to (imho) overly-verbose route names. Either way though, given the constraints of limiting any solutions to ones that don't change underlying routes, it looks like there's not much I can offer. Thanks for taking the time to discuss this. > (P.S.: The tone of this exchange was much improved. Thank you for > paying attention to this.) And thank-you for giving me the chance to approach this issue with the correct attitude. Regards, Trevor -- -- Trevor Squires http://somethinglearned.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
