<%- -%> in ERB template causes fatal error in JRuby
---------------------------------------------------
Key: JRUBY-3976
URL: http://jira.codehaus.org/browse/JRUBY-3976
Project: JRuby
Issue Type: Bug
Components: Extensions
Affects Versions: JRuby 1.3.1
Environment: OS X 10.5.8/Java 6/Intel 64
9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009;
root:xnu-1228.15.4~1/RELEASE_I386 i386
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) 64-Bit
Server VM 1.6.0_15) [x86_64-java]
Reporter: Russell Jurney
Priority: Critical
People are telling me I can squelch newlines in ERB templates by putting -
around things, as in <%- foo -%> instead of <% bar %>
In practice, however, the following code works:
<% @categories.each do |item| %>
<category name="<%= item %>"/>
<% end %>
and the following code does not work:
<%- @categories.each do |item| -%>
<category name="<%= item %>"/>
<% end %>
and it results in:
SyntaxError at /xml
/Users/rjurney/JRuby/views/xml.erb:4: , unexpected ';'
* file: xml.erb
* location: render_erb
* line: 2
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email