Topic: Shared Page Templates/Themes, Less HTML but how?

Hello, I am just getting into RoR and am ready to leave MS and .Net behind forever after building some simple controllers and classes. Wow. C# feels like a club instead of a scalpel now.

Anyway, I am having trouble finding what the equivilent to user controls (or include files) is. I am speaking specifically as it entails to the layout and css of the site.

<%= main_menu_control %>

<div id="PageStaticContent">blah</</div>

<%= footer_control %>

How do I do this with Ruby? Does anyone have a link that discusses layouts/themes/templates and how it pertains to creating skins for sites in Ruby?

Thanks, I have found a new girlfriend and her name is Ruby! (hopefully she wont *^%$ me from behind like MS and instead make sweet love to me)

Re: Shared Page Templates/Themes, Less HTML but how?

If you just want a file include in the view, partials is the way to go.

# in application.rhtml layout file
<%= render :partial => 'shared/main_menu' %>

# in views/shared/_main_menu.rhtml
<div id="main_menu">
  ... put menu content here ...

Here the content of the _main_menu.rhtml file will be rendered in place (included) in the layout.

If you want full out themes and skins that is a little harder. See this wiki page for some info on that.

Railscasts - Free Ruby on Rails Screencasts

Re: Shared Page Templates/Themes, Less HTML but how?

Thank you so much for the answer. Those are the directions I am going to look into then.