lil problem w/heredoc

P

Paul Vudmaska

I'm having some trouble w/heredoc.
this works

s += "
<div style='border-left:1px solid
#dddddd;padding:5;'>
<b class=label>#{child['title']}</b><br/>
<em title='#{child['ip']}'>#{child['client']}</em><br/>
#{parse(child['value'])}
<div style='border-bottom:1px solid #eeeeee;padding:8;'>
<a
href='javascript:add(#{child['id']})'>Reply</a>
</div>
<div style=margin-left:10>
#{node(child['id'])}
</div>
</div>
"
...but this does not..
s += <<-EOS
<div style='border-left:1px solid
#dddddd;padding:5;'>
<b class=label>#{child['title']}</b><br/>
<em title='#{child['ip']}'>#{child['client']}</em><br/>
#{parse(child['value'])}
<div style='border-bottom:1px solid #eeeeee;padding:8;'>
<a
href='javascript:add(#{child['id']})'>Reply</a>
</div>
<div style=margin-left:10>
#{node(child['id'])}
</div>
</div>
EOS

Anyone know what i'm doing wrong?

linux,ruby1.6,mod_ruby
 
S

Simon Strandgaard

I'm having some trouble w/heredoc. [snip]
..but this does not..
s += <<-EOS
<div style='border-left:1px solid [snip]
</div>
EOS

Anyone know what i'm doing wrong?

Ruby is sensitive to if there is whitespaces after the ending EOS.

Besides that I don't see any problems.
 
P

Paul Vudmaska

Simon said:
I'm having some trouble w/heredoc.

[snip]


..but this does not..
s += <<-EOS
<div style='border-left:1px solid

[snip]


</div>
EOS

Anyone know what i'm doing wrong?

Ruby is sensitive to if there is whitespaces after the ending EOS.

Besides that I don't see any problems.
!! I had a space following the EOS....now it's gone and it works. That's
kicked my buttox a couple times but no more,
Thank you Simon!
:p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top