# Multiple habtm tables comination

**URL:** <https://www.ruby-forum.com/t/multiple-habtm-tables-comination/133298>\
**Category:** Rails\
**Created:** [March 29, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/multiple-habtm-tables-comination/133298 "2008-03-29T20:48:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [March 29, 2008, 8:48pm UTC](https://www.ruby-forum.com/t/multiple-habtm-tables-comination/133298/1 "2008-03-29T20:48:07Z")

</div>

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: `map.resources :users, :has_many => [
:permissions ]` 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.
