Haml and the whitespace preservation problem with textarea and pre tags
Haml is to pretty-print your output in development. This wreaks havoc with preformatted text in pre and textarea tags. The first and simplest way is to just turn the pretty-printer off global by adding this haml.rb to your initializers
Haml::Template.options[:ugly] = true
You can also use a ~ instead of = in front of rails tag helper
.field
~ f.text_area :body, rows: 5
Written by René Kersten
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#