I have a layout.html.erb file w hich should act as a common file for all the pages to decorate as shown below.
<%= render :partial => "layouts/header" %>
<%= render :partial => "layouts/leftsidemenu" %>
<body>
<%= @content_for_layout %>
</body>
<%= render :partial => "layouts/footer" %>
How can I configure this rails framework so that, so that I do not want to include layout.html.erb in all the pages as
<%= render :partial => "layouts/layout" %>
I need to configuration file to decorate, as we do in Struts framework using sitemesh decorator.xml file.
thanks in advance
Mahesh
First of all, default layout for Rails app is in
<rails_app>/app/views/layouts/application.html.erband is used because all your controllers inherit from ApplicationController (see the name, as convention Rails use layout with same base name as controller, or name of parent controller and so on).Second, your layout should look something like that:
of even paste content from header and footer to this layout. More informations about layouts you can find in this guide.
If you want to change some aspect of page, for example title, then you can do so with layouts too:
If you want to use layout from different file, then you can do so that way: