ruby on rails - Multi - User Multi Environment -


i'm looking create app, each user can create own... "universe" in way, amount of items , names makes sense them, etc.

i've never done before, far i've had typical cases have users , admins, they're both looking @ same thing. here each user have separate environment.

obviously user should not able see else's environment.

can please point me right direction on subject? maybe useful gems or resources use started?

any advice welcome!

i'd start using plugin authentication, e.g. authlogic or devise 2 popular examples.

both of these let define user class.

then, when showing user stuff in environment, can make sure show them own stuff using has_many, , has_one, , has_and_belongs_to_many relationships in rails.

e.g. if facebook, might have this

class user < activerecord::base   has_many :news_items   has_many :friends   has_many :messages end 

in code refer

@user.news_items @user.friends @user.messages 

and relationships ensure showing information belonging user.

(caveat: in reality relationships more complicated, , need more complicated logic, should started)


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -