Routes for simple static part of site

I’ve created routes for the complex side of my web app, but I’m working
on an ‘about us’ section which is completely static. I’m a little
unsure as how the best way to do this and how the routes would be
configured.

there is a button that says “LEARN (about us)”

the url would be:

http://localhost:3000/learn

then there would be three options:

who we are
history
staff profiles

and the urls should be

http://localhost:3000/learn/who_we_are
http://localhost:3000/learn/history
http://localhost:3000/learn/staff_profiles

Do I create a learn_controller with 4 views files? index, who_we_are,
history and staff_profiles?

If so, how would I configure the routes?

Am i missing something?

Jimmy

For static content

#1) it is always advisable to have webserver serve these kinda pages
(About us, learn, help etc), I do not see any specific reason to serve
static pages from app servers (e.g mongrel etc). Unless and untill you
generate them dynamically or have few areas generating dynamic values
within those pages.
If you go by webserver route , This will make your site faster and
better and less load on app server which is already doing dynamic data.
I’m sure you know all this but that is just to express views on static
vs dynamic data.

#2) second way is drop static files in your app server public directory
, e.g /public folder and that’s it and Apache->mongrel will
automatically serve the files, if you do not have apache and if you are
using only app server on some port as you mentioned (3000) then also
idea is same. drop static files in public folder and it shud work. the
way routes works is ,

  1. look at public static folder, if not found
  2. look for dynamic data via controller->action route

#3) If at all you want to serve these page completely dynamic based on
controllers. You can modify your routes in bunch of different ways

a) as you mentioned to have "learn" controller and then specific 

actions in that controller to serve page accordingly and have a default
action in learn controller to serve a deafault page.

b) route learn to specific controller by changing routes like

  map.connect ':name', :controller => "<generic>", :action=> 

“”

where :name = can be anything , you can have anything in there , “learn”
“help” etc, is a controller name, and is action
name within that controlller. so everytime rails finds
localhost:3000/ it will dispatches it to
controller.

for detail on the last point check this url , good technique for these
kinda things

http://www.savedmyday.com/2007/11/07/screen-name-trick-in-rails-routes/

Hope that helps

OpenWeb20:
http://messagedance.com/openweb20

Jimmy P. wrote:

I’ve created routes for the complex side of my web app, but I’m working
on an ‘about us’ section which is completely static. I’m a little
unsure as how the best way to do this and how the routes would be
configured.

there is a button that says “LEARN (about us)”

the url would be:

http://localhost:3000/learn

then there would be three options:

who we are
history
staff profiles

and the urls should be

http://localhost:3000/learn/who_we_are
http://localhost:3000/learn/history
http://localhost:3000/learn/staff_profiles

Do I create a learn_controller with 4 views files? index, who_we_are,
history and staff_profiles?

If so, how would I configure the routes?

Am i missing something?