> I've already written at length about how edge-cases (poly* resources) > are being allowed to infect simpler cases:
One man's edge case is another's simple case. For me, polymorphic nested routes are common. I have stuff like /companies/1/tags and / people/1/tags as well as /people, /people/1, and /companies/6/people. > Trying to ram a rich set of arguments down the throat of form_for by > wrapping stuff up in an array is just plain ugly. I don't think it is. I think it's just using form_for as a delegate for url_for and ultimately polymorphic routes. I see nothing wrong with that. It's building on top of what we already have for the more involved cases while not complicating the simpler cases that already works today. > url_for([EMAIL PROTECTED], @child]) > polymorphic_url(@parent, @child) > > Seriously, what's clearer and easier to explain to a newcomer? url_for is not intended to be used like this directly. It's just used as a gateway to polymorphic_url when called from higher-level helpers. So there will be no explanation needed. > Save us all and stop trying to tunnel arguments to polymorphic_xxx > through the method signature of url_for and form_for. I disagree. I think the majority of the hurt you're experiencing is coming from the fact that whatever application you've worked on didn't deal with multiple paths to the same models, like /people (all people) and /companies/5/people (just the people for company 6). All the applications I've worked with deal with multiple paths to the same models. So that's what I've been involved with extracting. None of this stuff is about thought experiments, this is being extracted from real applications. Naturally, none of this can fit all scenarios all the time. Which is why I really enjoy the layered approach we have. You're free to almost at any spot to do something different than what's baked into the framework. Even stuff like :has_many resources is just a thin wrapper that calls resource methods you can almost as easily call yourself. In any case, it's great to hear about other use cases, but I would recommend (as Koz did earlier) that you turn down the tone of your arguments. The blog posting you link to is at least as inflammatory as your post to this group. Which is completely unnecessary. We're just interested in hearing about experiences. The louder you shout, the lower we'll set the volume on our attention. And that would be a shame as you do seem to have some relevant inputs on this discussion. I'd hate to see them disregarded entirely because of your choice of words. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
