Enable trim_mode via '-' in ERB templates
This adds whitespace supression optionally, similar to the default behavior in Rails ActionView ERB templates. Just add - to a %> like so: -%> and it will remove trailing whitespace and newlines. This can also be done to the beginning tag for removing newlines from the beginning of the tag line.
This commit is contained in:
1 parent
f29bf49a35
commit
f6d4badcd2
1 file changed
+1
-1
@@ -119,7 +119,7 @@ private ######################################################################
|
||||
end
|
||||
|
||||
def write_template(name, target, binding)
|
||||
compiled = ERB.new(export_template(name)).result(binding)
|
||||
compiled = ERB.new(export_template(name), nil, '-').result(binding)
|
||||
write_file target, compiled
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user