~ works as a replacement for = that runs the find_and_preserve helper,
which replaces newlines in textareas with the HTML newline escape char.
It doesn't do anything if the text doesn't contain a <textarea> (or
similar whitespace-preserving) tag. If you want to preserve a manually
generated textarea, call find_and_preserve helper manually and pass it a
block:
= find_and_preserve do
%textarea= stuff
- Nathan
Adam Salter wrote:
> Hey all,
> Trying to do a html textarea from Rails, but for reasons its too
> difficult to explain I've decided to do it by hand... anyway here's my
> sample code...
>
> %form{ :method => :post, :action => contact_us_path }
> %label{ :for => :comments }
> Your Comments
> %textarea{ :name => :comments, :style => "width: 350px; height:
> 200px;" }
> ~ @comments
>
>
> Looks ok right?
> Problem is that the comments text-area text gets successively indented
> on multiple passes.
>
> I understand that the ~ is supposed to remove/ignore indenting, but
> it's not working. Just wondering what I'm doing wrong?
>
> Thanks,
> -Adam
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---