# How to create Multi-User webapplication?

**URL:** <https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732>\
**Category:** Rails\
**Created:** [July 1, 2006, 5:48am UTC](https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732 "2006-07-01T05:48:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerard\_Netro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@Gerard\_Netro](https://www.ruby-forum.com/u/Gerard_Netro)\
**Post date:** [July 1, 2006, 5:48am UTC](https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732/1 "2006-07-01T05:48:43Z")

</div>

I’m kinda nuby! and i just want to know how to create a Multi-User Web  
application, where a person can register and can have his own subdomain  
for a blog… where people can view and visit it…

---

<div class="post-metadata">

**Author:** ![Gerard\_Netro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@Gerard\_Netro](https://www.ruby-forum.com/u/Gerard_Netro)\
**Post date:** [July 1, 2006, 6:07am UTC](https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732/2 "2006-07-01T06:07:04Z")

</div>

Go learn ruby and rails first. Start small. To do this you need  
extensive knowledge of teh framework to write an application, plus lost  
of knowledge of the server you want to deploy to, so you can setup up  
those rewrite rules. Learn the framework, write smaller applications,  
and learn more about what you want to deploy to.

---

<div class="post-metadata">

**Author:** ![Gerard\_Netro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@Gerard\_Netro](https://www.ruby-forum.com/u/Gerard_Netro)\
**Post date:** [July 1, 2006, 6:56am UTC](https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732/3 "2006-07-01T06:56:16Z")

</div>

Chris C. wrote:

> Go learn ruby and rails first. Start small. To do this you need  
> extensive knowledge of teh framework to write an application, plus lost  
> of knowledge of the server you want to deploy to, so you can setup up  
> those rewrite rules. Learn the framework, write smaller applications,  
> and learn more about what you want to deploy to.

* * *

I already create a blog, but it is limited only to me… i want a blog  
that anybody can register, if you know a tutorial about it… can you  
give me link… Thanks

---

<div class="post-metadata">

**Author:** ![Gerard\_Netro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@Gerard\_Netro](https://www.ruby-forum.com/u/Gerard_Netro)\
**Post date:** [July 1, 2006, 10:27am UTC](https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732/4 "2006-07-01T10:27:17Z")

</div>

## Try this link: [http://wiki.rubyonrails.org/rails/pages/LoginGenerator](http://wiki.rubyonrails.org/rails/pages/LoginGenerator)

View this message in context:  
[http://www.nabble.com/How-to-create-Multi-User-webapplication--tf1876211.html#a5130670](http://www.nabble.com/How-to-create-Multi-User-webapplication--tf1876211.html#a5130670)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Gerard\_Netro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@Gerard\_Netro](https://www.ruby-forum.com/u/Gerard_Netro)\
**Post date:** [July 1, 2006, 4:57pm UTC](https://www.ruby-forum.com/t/how-to-create-multi-user-webapplication/96732/5 "2006-07-01T16:57:42Z")

</div>

Ok, first you need support for many blogs. Create a blogs table in you  
database, with maybe some setting you might want, and a user\_id field.  
Also, edit your posts table to have a blog\_id column. Now create a blog  
model. It will have two declarations, has\_many :posts, and belongs\_to  
:user. The post model should have a belongs\_to :blog declaration, and  
the user model (which you will create in the next step) will have a  
has\_one :blog declaration.

Next, you need an authentication system. I reccommend “Acts As  
Authenticated”. There are lots of good tutorials on it, just google  
them. You will want to set it up so users can edit their own blogs, and  
see other peoples, should be pretty easy.

Next, set a route that is something like:  
map.connect ‘/:username’, :controller =\> ‘blog’, :action =\> ‘showblog’  
Have the ‘showblog’ action find blogs by username.

Now, heres the tricky part where you are oon your own. Figure out a  
rewrite rule that maps [username.domain.com](http://username.domain.com) to [domain.com/username](http://domain.com/username). Then  
you are pretty much done.

> I already create a blog, but it is limited only to me… i want a blog  
> that anybody can register, if you know a tutorial about it… can you  
> give me link… Thanks
