# Adding multiple users to my site?

**URL:** <https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023>\
**Category:** Rails\
**Created:** [February 9, 2007, 11:11am UTC](https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023 "2007-02-09T11:11:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![surfivor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@surfivor](https://www.ruby-forum.com/u/surfivor)\
**Post date:** [February 9, 2007, 11:11am UTC](https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023/1 "2007-02-09T11:11:18Z")

</div>

I have a site I set up for my band. Basically the main page URL is of  
the form:

[mysite.com/main/myband](http://mysite.com/main/myband)

myband is a method in the main controller

I am thinking of setting it up so many other bands can be on the site  
and so it could end up like this:

[mysite.com/main/bands/yourband](http://mysite.com/main/bands/yourband) .However, I am thinking I am lazy and  
it will cause subversion to have different files from the way I had it  
before all over the place and I have to figure all that out. Changin  
the directory structure while the site is allready working may mess  
something up that I diodn’t realize and it may take me awhile to  
straighten it all out.  
I did think by adding a /bands directory I could set up a base class  
in there to verify which band, but it doesn’t seem critical to do  
that.

I figure it would be just as easy to do it like this:

[mysite.com/main/bands?yourband](http://mysite.com/main/bands?yourband)

then I don’t have to bother restructuring my directories.

Maybe that’s all a dumb question, I don’t know. I have only been doing  
Rails for several months and come from more of a C++ development  
setting than web stuff.

---

<div class="post-metadata">

**Author:** ![surfivor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@surfivor](https://www.ruby-forum.com/u/surfivor)\
**Post date:** [February 9, 2007, 12:36pm UTC](https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023/2 "2007-02-09T12:36:02Z")

</div>

what i found out recently that using the power of the routes.rb makes  
everything MUCH easier. using it, i trimed off maybe 60 percent of my  
code.

would it look better if your url looked like this…

[mysite.com/band/yourband](http://mysite.com/band/yourband)

in the routes.rb you can set something like

map.connect “:band/:title”, :action =\> “myband”, :controller “main”

and then you can

def myband  
@myObj = Band.find(:first, :conditions =\> [“title =  
?”,params[:title]])  
…  
end

see gregs post in  
[http://www.ruby-forum.com/topic/96788#new](http://www.ruby-forum.com/topic/96788#new)

to convert bandtitle to a url so it will look like

[mysite.com/band/prince\_the\_purple\_rain\_singer](http://mysite.com/band/prince_the_purple_rain_singer)

---

<div class="post-metadata">

**Author:** ![surfivor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@surfivor](https://www.ruby-forum.com/u/surfivor)\
**Post date:** [February 10, 2007, 3:40am UTC](https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023/3 "2007-02-10T03:40:30Z")

</div>

On Feb 9, 6:36 am, koloa [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> map.connect “:band/:title”, :action =\> “myband”, :controller “main”
> 
> to convert bandtitle to a url so it will look like
> 
> [mysite.com/band/prince\_the\_purple\_rain\_singer](http://mysite.com/band/prince_the_purple_rain_singer)
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

I did it like this which seems to work well, but maybe there is an  
easier way as I had to map each individual action

map.connect ‘:band\_name’, :action =\> ‘show\_band’, :controller =\>  
‘main’  
map.connect ‘:band\_name/list\_gigs’, :action =\>  
‘list\_gigs’, :controller =\> ‘main’  
map.connect ‘:band\_name/show\_bio/:id’, :action =\>  
‘show\_bio’, :controller =\> ‘main’  
map.connect ‘:band\_name/show\_gig/:id’, :action =\>  
‘show\_gig’, :controller =\> ‘main’  
map.connect ‘:band\_name/bio\_menu’, :action =\>  
‘bio\_menu’, :controller =\> ‘main’  
map.connect ‘:band\_name/list\_gigs’, :action =\>  
‘list\_gigs’, :controller =\> ‘main’  
map.connect ‘:band\_name/rss\_menu’, :action =\>  
‘rss\_menu’, :controller =\> ‘main’

map.connect ‘:controller/:action/:id.:format’  
map.connect ‘:controller/:action/:id’

---

<div class="post-metadata">

**Author:** ![surfivor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@surfivor](https://www.ruby-forum.com/u/surfivor)\
**Post date:** [February 10, 2007, 2:49am UTC](https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023/4 "2007-02-10T02:49:27Z")

</div>

I don’t know the answer to your question but had to add my $0.02 😉  
Sounds like you are using a canon to swat a fly.

If you are wanting to get this sorted out quickly there are plenty of  
content management systems around that would let you host multiple  
bands websites on the same site.

However if you are wanting to do this in ruby and you are displaying  
the same kinds of information about each band then I suggest that you  
use a database to store the band info.

---

<div class="post-metadata">

**Author:** ![surfivor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@surfivor](https://www.ruby-forum.com/u/surfivor)\
**Post date:** [February 10, 2007, 3:47am UTC](https://www.ruby-forum.com/t/adding-multiple-users-to-my-site/85023/5 "2007-02-10T03:47:30Z")

</div>

On Feb 9, 8:48 pm, “reed” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

My band has a site on myspace that I put up: [www.myspace.com/](http://www.myspace.com/)  
freespiritboston

Then we had an older site someone did but the guy who did the site is  
on the other coast and only  
he can update the site or something: [www.freespiritboston.com](http://www.freespiritboston.com) . So  
nothing much ever happens with it.

I am building this site: [www.freespiritboston.net](http://www.freespiritboston.net) with Rails. It has a  
database and an admin section so that the shows can  
be entered which it google maps the shows based on what was entered by  
the admin. It has a tinyMCE content editor for the  
bios. I will add some other stuff. The front part of the site is some  
ajax stuff. Some musician friends of mine also need web sites and  
don’t have alot of money, so I am setting my site/database to handle  
multiple bands besides my band. If I do that, I might as well look  
into hosting other bands and maybe making a little cash or something,  
but it’s ben fun at any rate.
