Forum: Ruby on Rails redering CDATA wierdness

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
paqo (Guest)
on 2005-12-12 00:36
I am attempting to do the sortable_element tutorial from scriptaculous.
(http://demo.script.aculo.us/ajax/sortable_elements)

Upon viewing the script.aculo.us source, I see this line is generated...

<script type="text/javascript">Sortable.create('list',
{onUpdate:function(){new Ajax.Updater('list-info', '/ajax/order',
{onComplete:function(request){new Effect.Highlight('list',{});},
parameters:Sortable.serialize('list'), evalScripts:true,
asynchronous:true})}})</script>

When I try to do the same thing, Webrick generates the following on my
local machine...

<script type="text/javascript">
//<![CDATA[
Sortable.create('list', {onUpdate:function(){new
Ajax.Updater('list-info', '/moving_list/order', {asynchronous:true,
evalScripts:true, onComplete:function(request){new
Effect.Highlight('list',{});},
parameters:Sortable.serialize('list')})}})
//]]>
</script>

My app is so simple I dont know what I could be doing wrong.  Because
this line is treated as a comment, my page doesnt work.

Any ideas?

Thanks
paqo
Ryan K. (Guest)
on 2005-12-12 05:12
(Received via mailing list)
On Dec 11, 2005, at 2:36 PM, paqo wrote:

> parameters:Sortable.serialize('list'), evalScripts:true,
> Effect.Highlight('list',{});},
> parameters:Sortable.serialize('list')})}})
> //]]>
> </script>

This would be the xhtml way of doing things. Its possible that you're
not actually sending an xhtml doctype, which could cause the <style>
element to interpreted as a comment. Anyway, a url would help.

-ryan
This topic is locked and can not be replied to.