This project is archived and is in readonly mode.
Whitespace Bug in Erb Comments in Rails 2.2.2
Reported by ijayasin | December 15th, 2008 @ 09:04 PM | in 2.x
Hi,
There seems to be a bug in Erb comments when there are white spaces between the <% and # of the Erb tag. I've noticed this in Rails 2.2.2. This has worked in Rails 2.1.0 and older.
<%# This is comment causes no problems %>
<% # This comment will exclude content up to the next Erb tag %> This text will be removed<%= "but this will be rendered" %> from the output.
In the above example the following is returned to the browser:
but this will be rendered from the output.
Comments such as these were working up until Rails 2.1.0.
Thanks,
Indika
Comments and changes to this ticket
-
josh December 15th, 2008 @ 09:09 PM
- State changed from new to wontfix
It could be an ERB bug which is a ruby core lib.
We don't really touch anything that ERB does, so I'm not sure how it would brake from 2.1 to 2.2.
-
Jeremy Kemper December 16th, 2008 @ 02:16 AM
A comment with a leading space only worked by accident.
<%# is the only supported ERB comment tag.
-
ijayasin December 16th, 2008 @ 08:00 PM
Jeremy and Joshua,
Thanks for the responses guys.
@Jeremy: I realized that too while taking a closer look at the Ruby/Erb documentation. So I ran a couple of quick-and-dirty tests under Ruby 1.8.6 and 1.8.7 and both of them didn't like the whitespaces, so I'm not sure why it worked under Rails <=2.1.0.
I've already updated my code and removed whitespaces. Hopefully this lil' thread will help others experiencing the same issue. :)
Thanks,
Indika
-
lacewigs June 11th, 2010 @ 08:13 AM
supply in stock and custom lace front wigs, full lace wigs, lace wigs, human hair wigs, remy lace front wigs, cheap wigs, cheap, buy, celebrity
full lace wigs
lace wigs
lace wigs sale
lace front wigs
synthetic front lace wigs
Full Lace Front Wig, Long & Short Hair Wigs: 80% OFF at Celebrity Wigs. We ensure 100% customer satisfaction with our Long & Short Indian Remy Hair Wigs.
cheap wedding dresses
cheap evening dresses
cheap prom dresses
cheap evening dresses
cheap prom dresses -
Ryan Bigg October 9th, 2010 @ 10:12 PM
- Tag cleared.
- Importance changed from to Low
Automatic cleanup of spam.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Referenced by
- 955 ruby 1.8.7 and erb problem See #1580