On 10/12/07, Dan Kubb <[EMAIL PROTECTED]> wrote: > >> How about mentioning conventions for searching using query strings > >> that I've seen in ActiveResource? Any extra params you send through > >> to the find() method are added to the query string. Here's an > >> article > >> exploring different conventions for search: > > > > http://woss.name/2007/07/22/convention-for-restful-search-in- > > rails/ > > > > That's a great suggestion, but right know there doesn't seem to be > > any "standard" for how to do it. Many if resource_search gets > > standardized (and integrated into Rails) then we can make *that* the > > convention... > > It sort of is a convention right now in ActiveResource, although not all > Rails apps make use of it. In the docs [1] for ActiveResource#find it > shows the following example: > > Person.find(:all, :params => { :title => "CEO" }) > # => GET /people.xml?title=CEO > > I admit we're a long way away from real standardization on the server > side though.. > > [1] http://edgedocs.planetargon.org/classes/ActiveResource/ > Base.html#M001761
Personally, for search, I find that /people.xml?q=a_ferret_compatible_query_or_similar is nicer than the above, and more flexible, in general. Yes it's RPCish, but this is one of those times where loosening the metaphorical bolt is warranted, I think. Also, what's the best practice w.r.t. URL nesting for polymorphic resources? We try to limit ourselves to not nesting more than 2-levels deep (e.g., /posts/1/comments is 2-level deep). One additional level is OK as long as it's due to a namespace. So /admin/posts/1/comments is ok. What do you think? -- Bosko Milekic <[EMAIL PROTECTED]> http://www.crowdedweb.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 -~----------~----~----~----~------~----~------~--~---
