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 <rails root>/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, <generic> is a controller name, and <someaction> is action
name within that controlller. so everytime rails finds
localhost:3000/<something> it will dispatches it to <generic>
for detail on the last point check this url , good technique for these
Hope that helps
Jimmy Palmer wrote: