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:
@@ -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