# Create rows in alternate tables

**URL:** <https://www.ruby-forum.com/t/create-rows-in-alternate-tables/128446>\
**Category:** Rails\
**Created:** [February 7, 2008, 7:36pm UTC](https://www.ruby-forum.com/t/create-rows-in-alternate-tables/128446 "2008-02-07T19:36:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chmeee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/7993a0/32.png) [@Chmeee](https://www.ruby-forum.com/u/Chmeee)\
**Post date:** [February 7, 2008, 7:36pm UTC](https://www.ruby-forum.com/t/create-rows-in-alternate-tables/128446/1 "2008-02-07T19:36:32Z")

</div>

I’ve looked everywhere I could think, but can’t find an answer to this  
question:

I’m writing a Rails application that uses an arbitrary number of  
groups of 4 tables, each group belonging to a user. Now, I want to  
insert new rows into the user’s own tables, rather than a single  
global table. Thus I cannot just use the set\_table\_name method to set  
a table name, since it would affect all inserts from all users, and I  
want it just from the current user, generated at session time.

Is there a way to do this with Rails? I can only find information on  
querying alternate tables, not inserting into them.

Thanks
