I have a site I set up for my band. Basically the main page URL is of the form: 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 .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 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.
on 2007-02-09 11:11
on 2007-02-09 12:36
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 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 to convert bandtitle to a url so it will look like mysite.com/band/prince_the_purple_rain_singer
on 2007-02-10 02:49
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.
on 2007-02-10 03:40
On Feb 9, 6:36 am, koloa <rails-mailing-l...@andreas-s.net> 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 > > -- > 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'
on 2007-02-10 03:47
On Feb 9, 8:48 pm, "reed" <reed...@gmail.com> wrote: > My band has a site on myspace that I put up: 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 . So nothing much ever happens with it. I am building this site: 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.