Multiple habtm tables comination.

Hi.

I need to make a habtm relation between a user model and the permissions model, a pages model and the permissions model.

If i do this in the routes: [code]map.resources :users, :has_many => [ :permissions ][/code] so that I can access the permissions though the users controller. But this generates a parameter named user_id, but if I do the same routing with the pages, I can access the permissions through pages, but this generates a pages_id parameter.

So how do i change the parameter to something like parent_id so i can sort without having to make a lot of if-loops to check which parameters have been set.