Topic: Namespaces and nested resources
I'm developing online game (Heroes fighting against Clans) and i'm planning next structure of my app: i've got top-level resources Heroes (profiles of supermembers) and Clans (profiles of groups of members). So i've got both HeroesController and ClansController.
What i wanna do is give Heroes and Clans' leaders opportunities to add "Content Resources" to their profile area or to the clan area, respectively. "Content Resources" is different singular resources such as Gallery, Blog, Shop and others. So Gallery has many Photoalbums (that have many Photos), Blog has many Posts, Shop has goods and so on.
Hero can turn on/off each of singular Content Resources, and after that he get its full functionallity on his own profile page
The same thing with Clans - clan leader can connect in settings area for example Forum.
So the question is how to organize this structure well. I think about that way:
namespace :blog do
resources :blogs do
namespace :gallery do
resources :galleries do
And here i've got a first problem - how to attach Gallery to Hero and/or Blog to Clan?
May be i'm doing everything wrong. May be i should choose another way.
I'm new in Rails, and i'm sorry for maybe easy questions
Grateful for any help!
Last edited by Ajaxy (2011-08-04 13:42:20)