Handling different routes (with different params) for the same controller
===

PROBLEM DESCRIPTION:

I have a intermediate table X to map Elements from table A to elements from table B.

This table X contains also many columns regarding properties of this mapping. The uniqueness of a record in table X is not just the id od A and id od B but also a unique identifier that represents the mapping.

When trying to update a property of table X, I added to routes:

map.A :only=>[:none] do |a|
    a.resources B :controller=>X :only[:update]
end

map.resources x :only=>[:update]

So this basically gives me to possible urls to access the update method of my X controller.

QUESTION:
My question is: how can I tell when the controller was accessed by passing A and B or just X identifier? I know that looking at the params I can check if A is present and if not then it mus be X but this is not very practical/secure. If it gets more complicated I will need multiple ifs to detect the exact case.

Even worst, imagine that for some reason I have another route like: 

map.resources Y :controller=>X :only[:update]

Then in my params hash I would just have :id so and if condition wouldn't even work...

COMMENTS:
I wish there was a :key option for the routes so you could rename the keys in the parameters hash but from what I have read in Rails 2 there is no such a thing and I would like to avoid plugins if possible. Isn't there a better way than if cases or parsing the url to tell what parameters where passed so I can look up my database?

Thanks!!!