Search code examples
ruby-on-railsform-helpers

Rails adding whitespace in HAML


Okay I have faced this sort of problem below and every single time all I have had do is just make haml not sanitize the output but this isn't working. I have tried using raw, html safe but neither of those helped.

Here is what I am calling

def call_form 
  "SOME STRING #{"LOL"} SOME OTHER STRING"
end

And in my view I use != call_form

and this is the output in HTML:

"
      SOME STRING LOL SOME OTHER STRING
      "

How do I get rid of all that whitespace that rails keeps adding


Solution

  • There was a problem with my form. I had forgotten to close an element in my HTML which is why it was the BROWSER that was actually adding the space. Thanks for your help anyways though. I appreciate it.