Brandon S. wrote:
This is probably a very basic question, but what is the proper
controller & routing setup if I’m setting up a RoR site with static
I want each of these pages to use a single template file that I can push
content to. It seems like overkill to create individual controllers for
about, services, and contact, so what is the best way to set this up?
What I’ve done is create a simple controller called “site” which will
group all my contact/about/privacy terms/etc pages together. Then I use
routes to direct “/about” to “/site/about”:
map.contact '/contact', :controller => 'site', :action => 'contact'
map.about '/about', :controller => 'site', :action => 'about'
map.terms '/terms', :controller => 'site', :action => 'terms'
map.privacy '/privacy', :controller => 'site', :action => 'privacy'