# Re: Simple rails website design question

**URL:** <https://www.ruby-forum.com/t/re-simple-rails-website-design-question/114482>\
**Category:** Rails\
**Created:** [September 13, 2007, 6:45am UTC](https://www.ruby-forum.com/t/re-simple-rails-website-design-question/114482 "2007-09-13T06:45:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre\_hartawan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@andre\_hartawan](https://www.ruby-forum.com/u/andre_hartawan)\
**Post date:** [September 13, 2007, 6:45am UTC](https://www.ruby-forum.com/t/re-simple-rails-website-design-question/114482/1 "2007-09-13T06:45:00Z")

</div>

hi eggie5, you could read this book “Apress - Beginning Ruby On Rails  
E-Commerce - From Novice To Professional”,there are examples just you  
mentioned bellow

----- Original Message ----  
From: eggie5 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: Ruby on Rails: Talk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, September 13, 2007 11:37:59 AM  
Subject: [Rails] Simple rails website design question

I want to make a simple website with rails, but I’m confused about how  
to setup my controllers. Here’s what I want:

5 pages: Home, Products & Services, Press Center, White Papers & About  
us

So, I’m confused about how to set this up. Should each page have it’s  
own controller, e.g.:

home\_controller, products\_controller, press\_controller,  
white\_papers\_controller and about\_us\_controller

Is this a wise design decision?

I would like to use a layout “template” for all the pages. How then,  
if I’m using independent controllers for each page do I share a  
layout?

All the rails site examples I’ve found are kinda non-standard sites  
with only 1 real page, like a shopping cart, so I’m not sure how to  
structure my rails app for a site with many pages.

Can you cite any examples?

* * *

Building a website is a piece of cake. Yahoo! Small Business gives you  
all the tools to get online.

> **[Turbify.com | Buy a Domain | Websites & Domains | Purchase a URL - Turbify](https://www.turbify.com)**
>
> Turbify is a trusted internet domain registrar headquarter in Rockville, Maryland offering Domain Name, Web Hosting, Business Email, Website Builder, Local Business Listing and eCommerce Store services.

---

<div class="post-metadata">

**Author:** ![andre\_hartawan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@andre\_hartawan](https://www.ruby-forum.com/u/andre_hartawan)\
**Post date:** [September 16, 2007, 1:20pm UTC](https://www.ruby-forum.com/t/re-simple-rails-website-design-question/114482/2 "2007-09-16T13:20:19Z")

</div>

You could have home controller with subpages as actions. Like  
…/home/products … with /home/index beeing default.

But then again if you like more restful approach you could create all  
those controllers and put a single redirect\_to into each one of them and  
stil have single (complicated) source file.

If you have more controllers but want a single layout than name your  
layout ‘application.rhtml’. This layout is valid for all controlers  
that do not have their own layout defined.

by  
TheR
