# Multiple Tables in Single Resource?

**URL:** <https://www.ruby-forum.com/t/multiple-tables-in-single-resource/147868>\
**Category:** Rails\
**Created:** [September 6, 2008, 10:56am UTC](https://www.ruby-forum.com/t/multiple-tables-in-single-resource/147868 "2008-09-06T10:56:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MediaJunkie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@MediaJunkie](https://www.ruby-forum.com/u/MediaJunkie)\
**Post date:** [September 6, 2008, 10:56am UTC](https://www.ruby-forum.com/t/multiple-tables-in-single-resource/147868/1 "2008-09-06T10:56:40Z")

</div>

I’m new to Ruby/Rails, so bear with me while I try to explain what I’m  
looking to do. If someone doesn’t have time to explain, but could  
nudge me in the right direction, I’d really appreciate any help at  
all.

I’m looking to setup a site that has multiple sections each using a  
single resource with different tables. The best way I can describe it  
is, lets say I have two different blogs.

first\_blog  
second\_blog

I want them to use a single Post resource in that…

first\_blog/posts/1  
second\_blog/posts/1

pulls up two different entries.

Now I’m thinking the best way to do this to nest the resource within  
each blog, but I need each Post to use a separate table. In other  
words, first\_blog may have a title and body row in the table and  
second\_blog may only have a body row and some date.

Again, I’m new to all this, so I appreciate any attempts and trying to  
figure out what I’m looking for and suggestions on how to actually do  
it.

Thanks

---

<div class="post-metadata">

**Author:** ![MediaJunkie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@MediaJunkie](https://www.ruby-forum.com/u/MediaJunkie)\
**Post date:** [September 6, 2008, 9:06pm UTC](https://www.ruby-forum.com/t/multiple-tables-in-single-resource/147868/2 "2008-09-06T21:06:49Z")

</div>

I’m not really sure if I’m asking the right question. So here is a  
little more information.

I’m attempting to put together an admin section to store posts for  
several different sections of a site. I’d like to have it setup like  
so.

[http://www.website.com/section/1/posts/1](http://www.website.com/section/1/posts/1)  
[http://www.website.com/section/2/posts/1](http://www.website.com/section/2/posts/1)

I could nest the post within the section and link the tables together  
in the database, but can I create multiple tables, one for each  
section?

The first section might need four columns in it’s table and the second  
may need only one column in it’s table.

If this a completely moronic way of setting this up, please let me  
know that as well.

Thanks Again.
