Sorry that I don’t have the proper terminology to more concisely describe my database design question. Put in an example scenario:
-
User Charley logs onto a forum (“forum” merely as example app here), and before he is taken to the forum interface he must select which room he wants to go into. The only rooms available are “People into drama” and “People into scifi”. Charley is dissatisfied with the selection, and has the ability to make his own room called “People into action”, which he then choose to go into. “People into action” has the complete same forum interface as the other rooms, except is unpopulated.
-
User Franny logs onto the same forum app, and now sees there are 3 rooms, including the one Charley previous created. She could then also create her own room, or go into the room Charley has just created.
*For additional clarification, I envision /roomname1/forum and /roomname2/forum, where the forum is the same app with the same display and functions, but the posts it show would be different based on first part of the URI with roomname. What I have difficulty understanding is how to properly associate a post’s post.room (given that a room has_many posts, and a post belongs_to a room) with what the first part of the URI where the roomname is identified.
I have just recently completed the Hartl’s Rails Tutorial, and thought I’d get more experience making my own modifications to the default Twitter-like app. My goal here would be to set up these “rooms” where users could see the universe of microposts associated only with the “room” they are in, and not others.
Thanks for your help!
There are many ways you could do this, here is a quick high level that should get you started.
You could build and add to this to enable users to delete/edit rooms they have created as a next step perhaps. You may want to associate posts, so they could
belong_tofor example. Hope this helps get you started!