ERB: Format for trim_mode string

F

Farrel Lifson

In the documentation for ERB.new
(http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html#M000649)
it says:

"If trim_mode is passed a String containing one or more of the
following modifiers, ERB will adjust its code generation as listed:

% enables Ruby code processing for lines beginning with %
omit newline for lines ending in %>"

What is the format for this trim_mode string? I specifically want to
use the % and <> modes. I tried passing through "%<>" but it doesn't
seem to be working.

Farrel
 
W

Wu Junchen

Farrel said:
In the documentation for ERB.new
(http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html#M000649)
it says:

"If trim_mode is passed a String containing one or more of the
following modifiers, ERB will adjust its code generation as listed:

% enables Ruby code processing for lines beginning with %


What is the format for this trim_mode string? I specifically want to
use the % and <> modes. I tried passing through "%<>" but it doesn't
seem to be working.

Farrel

maybe your <% ruby code %> must start at the beginning of the line,there
mustn't be no more white space.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top