Topic: restful searching

I've got an app that is using restful routes and I'm eventually going to implement a search engine (acts as ferret unless anyone has a better suggestion).  I have a bunch of nested routes but before I tie them all together I wanted to ask a question about flexibility.

If a place can be reached by

place/1 or regions/3/place/1  is that going to give a search engine a hard time?  Already I'm having a difficult time figuring out how to work the "show" links. 

For example, in regions/3 if I list all the places, then clicking on show brings me to place/1 instead of regions/3/place/1

In order for me to get show to bring me to regions/3/place/1 I have to get rid of the nested route for place (map.resources :places do |places|)and also get rid of my name_prefix in the regions nest:

  map.resources :regions do |regions|
          regions.resources :places, :name_prefix => 'region_' do |places|
            place.resources :addresses

So, what do you all think? Is too much flexibility bad when it comes to routes?  Is it more trouble than it's worth?  I sort of want to settle on a way forward before I tackle search.

Thanks in advance for the advice..

Re: restful searching

Have you seen Jamis Buck's blog post on nesting resources? He recommends not nesting resources beyond one "id" deep. As it's kind of silly to say "/regions/3/place/1" when you can just say "/place/1". If you don't bother with the former at all I think it will clear things up.

Railscasts - Free Ruby on Rails Screencasts

Re: restful searching

I just read that post... thanks (BTW- I know Peepcode's already done a rest episode but a few mini railscasts on the subject would be oh so good.. contact me if you want some suggestions..).

So generally, the way to go would be to do one level nesting:

             |-> parks/1/tables/4
                          |-> tables/4/seats/1

etc, etc.

That should make searching ok since it'll probably return the controller/:id which would always work in this scenario.

Thanks for the advice!