views:

83

answers:

1

Using 2.3.8 of rails.

In the view template I have this type of code

<%content_for :sidebar do %>
  <h2>Sidebar</h2>
  <p><%=link_to "somewhere", "http://www.google.com/"%&gt;&lt;/p&gt;
<% end %>

<h1>Pictures#new</h1>
<p>Find me in app/views/pictures/new.html.erb</p>

In the application.html.erb template I have

<!-- END: Header -->
<%= yield(:sidebar) %>
</div>

<div class="gb">
<%= yield %>

When I go to view the page in a browser instead of showing the code correctly in named yield it is escaping all the tags. EG;

&lt;h2&gt;Sidebar&lt;/h2&gt;
  &lt;p&gt;<a href="http://www.google.com/"&gt;somewhere&lt;/a&gt;&amp;lt;/p&amp;gt;

I can't figure out what is going wrong. Help! Thanks.

A: 

I see a random </div> in your application.html.erb file--maybe that's causing the problem?

mportiz08
I don't understand?Could you provide more detail.
Attis
There's an end div tag, but it doesn't seem to be preceded by a beginning div tag
mportiz08
I've boiled the application.html.erb file to just these two lines<%= yield :sidebar %><%= yield %>and it is still doing the escaping of tags
Attis
alright--wasn't sure if that was the problem--just checking
mportiz08