I am building a ruby on rails application using simple form and haml for the views. However I've noticed an issue with regards to forms that have textareas. I didn't notice it at first however when I save some text in a textarea and dump it in a pre tag I've noticed that every line break is followed by a number of ugly white spaces. I'm not sure whats going on here. So if I enter something like the following in a textarea:
THIS IS ONE LINE
THIS IS ANOTHER LINE
THIS SHOULD NOT BE INDENTED
THIS SHOULD BE INDENTED BY TWO SPACES
Outputting it into a pre tag gives:
THIS IS ONE LINE
THIS IS ANOTHER LINE
THIS SHOULD NOT BE INDENTED
THIS SHOULD BE INDENTED BY TWO SPACES
I'm pretty lost here - this is my basic textarea code - nothing much(added the tilde after hearing that it would help in removing unwanted spaces - didn't work at all):
~f.input :details, :label=>false, :input_html=>{:class=>'span12 input-code', :rows=>40}
Another observation - the spaces do not show up in the textarea if I render the text area using simple form - however if I manually code in a textarea to output the contents it shows the spaces. Could this have anything to do with the simpleForm gem?