This is my code. I have a problem with spaces. I can not get the proper generation
- if @lastday.nil? && @lastday != item.created_at.strftime("%d %b %Y")
.daily-entry
%h1.date
=h item.created_at.strftime("%d")
%span
=h item.created_at.strftime("%b, %Y")
-else
.entry
%h1
= link_to item.title, "/items/#{item.id}"
Generates this is
<div class='daily-entry'>
<h1 class='date'>
20
<span>
Sep, 2009
</span>
</h1>
</div>
<div class='entry'>
<h1>
<a href="/items/15">xcvxcvx</a>
</h1>
</div>
But I want a HTML
<div class='daily-entry'>
<h1 class='date'>
20
<span>
Sep, 2009
</span>
</h1>
<div class='entry'>
<h1>
<a href="/items/15">xcvxcvx</a>
</h1>
</div>
</div>
.daily-entry
should be included in the condition
if condition true
<div class='daily-entry'>
<h1 class='date'>
20
<span>
Sep, 2009
</span>
</h1>
<div class='entry'>
<h1>
<a href="/items/15">xcvxcvx</a>
</h1>
</div>
</div>
if condition false
<div class='entry'>
<h1>
<a href="/items/15">xcvxcvx</a>
</h1>
</div>