I am new to RoR, so forgive me as I know this is fundamental, but what
is the "standard" for creating basic site pages like: home, about,
contact, etc. I definitely understand the MVC approach and therefore
do not want to couple these pages with other components. My guess is
to create a "site" controller to manage these types of pages... Not
sure, so I wanted to get more direction before I make something
harder.
Where do I put basic site pages?
How do I map these in routes.rb so they appear as mysite.com/about,
but do not conflict with other rules?
Thanks for the response. I am looking for something a bit more elegant
as far as the routes. I don't want to go to home/about or home/
contact. I understand the general container controller and will adopt
that practice. However, I am wondering if I can make a default rule
that would allow me to go to /about, /contact, etc and they map
accoardingly to the :controller => "home" as "home/:action".
So I guess the question now is, can anyone tell me how to write that
rule?
in the cong directory you have a routes.rb archive there yo can arrange your routes, the default are for each controler a route is created containing the destroy, create, new , update .
For example if you have a home controller this will be created:
map.resources :home , this will let you access from your browser to /home/new home/edit/id home/ (the index), each of this will have a view related.
Thanks for the reponse. I undertand the controller routing. But this
is not the functionality I am after.
I want a route, that defaults to a "home" controller, but doesn't
interfer with other routes. In addition, it would allow me to use URLs
like /about /contact, not /home/about, /home/contact.