Reputation: 295
i have a table in my application.html.erb.like this:
<body>
<table width='100%' border='3'>
<tr><td height="100"> </td></tr>
<tr>
<td width="10%"></td>
<td width="80%"></td>
<td width="10%"></td>
</tr>
</table>
<%= yield %>
</body>
i want to put contents of other page in <td width="80%"></td>
but i dont know how can i do that?
thank you for your helps
Upvotes: 0
Views: 186
Reputation: 1430
<body>
<table width='100%' border='3'>
<tr><td height="100"> </td></tr>
<tr>
<td width="10%"></td>
<td width="80%"><%= render "other_page" %></td>
<td width="10%"></td>
</tr>
</table>
<%= yield %>
</body>
This will render _other_page.html.erb
.
Read more about it here: http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials
Upvotes: 1
Reputation: 115362
Simply move the yield
statement:
<body>
<table width='100%' border='3'>
<tr>
<td height="100"></td>
</tr>
<tr>
<td width="10%"></td>
<td width="80%"><%= yield %></td>
<td width="10%"></td>
</tr>
</table>
</body>
Upvotes: 1