Forum: Ruby on Rails Escape sequences in html_options?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Duane (Guest)
on 2006-06-05 22:14
I hate asking questions like this, but I swear I've been looking for the
answer for the better part of the morning.

I want to execute some javascript onChange for a select box, so I have:

:onchange=>"for (var x=1; x <= this.options.length; x++) {....}"

The problem is that the <= is being translated into &lt;= and I don't
that :-/.  Nothing I've tried (various combinations of single/double
CGI::escape / unescape, etc..) seems to fix it.  What I'm trying to
figure out is when exactly my < character is being translated, and
therefore what options I have for preventing that.  I even tried putting
the whole thing in a CDATA section but that didnt seem to fly, either.

This topic is locked and can not be replied to.