How to show menu in application.html.erb on other pages?

I am using Aptana Studio 3 to write a small application.

In the Views folder, I added a new .html.erb page and added a jQuery
navigation menu bar. This page also has a banner. I want to keep this as
a base page (like Master Page in .NET) for all the other pages.

I want all the other pages to automatically show the banner and menu bar
on top.

How to do this? I am using Rails 3.2.

Code of application.html.erb:

<%= stylesheet_link_tag "application", :media => "all" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %>
  <script type="text/javascript" 

src="…\Libraries\jquery.min.js">


/* General */
#cssdropdown, #cssdropdown ul { list-style: none; }
#cssdropdown, #cssdropdown * { padding: 0; margin: 0; }

        /* Head links */
        #cssdropdown li.headlink { width: 220px; float: left; 

margin-left: -1px; border: 1px black solid; background-color: #e9e9e9;
text-align: center; }
#cssdropdown li.headlink a { display: block; padding: 15px;
}

        /* Child lists and links */
        #cssdropdown li.headlink ul { display: none; border-top: 1px 

black solid; text-align: left; }
#cssdropdown li.headlink:hover ul { display: block; }
#cssdropdown li.headlink ul li a { padding: 5px; height:
17px; }
#cssdropdown li.headlink ul li a:hover { background-color:
LightBlue; color:Black }

        /* Pretty styling */
        body { font-family: verdana, arial, sans-serif; font-size: 

0.8em;}
#cssdropdown a { color: white; } #cssdropdown ul li a:hover
{ text-decoration: none; }
#cssdropdown li.headlink { background-color: Blue;}
#cssdropdown li.headlink ul { background-position: bottom;
padding-bottom: 10px; }

<%= yield %>
    <div id="divMain">
        <div id="divHeader">
            <img src="..\Images\W.png">
        </div>
        <div id="divMenu">
            <ul id="cssdropdown">
            <li class="headlink">
                <a href="#">Task</a>
                 <ul>
                  <li><a href="#">Add New</a></li>
                 </ul>
                 </li>
                  <li class="headlink">
                  <a href="#">Reports</a>
                     <ul>
                  <li><a href="#">Report</a></li>
                 </ul>
             </li>
            </ul>
        </div>
    </div>
<%= content_for?(:content) ? yield(:content) : yield %>

Code of Content.html.erb

    <% content_for :content do %>
      <div id="divMain"></div>
      <%= content_for?(:news_content) ? yield(:news_content) : yield 

%>
<% end %>
<%= render :template => ‘layouts/application’ %>

On Mon, May 27, 2013 at 10:57 AM, Rohit Coder
[email protected] wrote:

I am using Aptana Studio 3 to write a small application.

ProTip: no one cares what editor you’re using.

In the Views folder, I added a new .html.erb page and added a jQuery
navigation menu bar. This page also has a banner. I want to keep this as a
base page (like Master Page in .NET) for all the other pages.
I want all the other pages to automatically show the banner and menu bar on
top.

Your primary layout file, by default application.html.erb, is there to
wrap page-specific content. You can include and position elements
in that layout however you choose.

Have you worked through a Rails tutorial yet?

Yes Schroeder, I referred Rails documentation but I am not able to solve
my requirement.

On Mon, May 27, 2013 at 11:51 AM, Rohit Coder
[email protected] wrote:

Yes Schroeder, I referred Rails documentation but I am not able to solve my
requirement.

Really? You haven’t seen something like this?

<%= render :partial => 'layouts/banner' %> <%= render :partial => 'layouts/menubar' %>

<%= yield %>

Because that’s pretty much all you need…

I included that line you suggested. Below is the code of my content
page:

<% content_for :stylesheets do %>

<% end %>

<% content_for :MainContent do %>

<% end %>

<%= render :partial => “layouts\application.html.erb” %>

=================================================

On Mon, May 27, 2013 at 12:24 PM, Rohit Coder
[email protected] wrote:

I included that line you suggested. Below is the code of my content page:

<%= render :partial => “layouts\application.html.erb” %>

Completely and utterly backwards. If you’ve actually gone through
a Rails tutorial, you apparently haven’t understood it at all.

application.html.erb is the “Master Page” you want.