manyu
manyu

Reputation: 291

Escaping of double quotes in rails 3.2

I have recently ungraded to rails 3.2 and getting a problem with the escaping of double quotes. I have a string like this

options = "class=\"input\" disabled=\"disabled\" value=\"[{\"id\"=>\"514aede7\",    \"label\"=>\"document\"}, {\"id\"=>\"3a55e040\", \"label\"=>\"license\"}]\""

and i use this as part of my list options as in one of my helper functions

"<ol #{options}></ol>"

but since i have upgraded to rails 3.2 and ruby 1.9 my list is floating in html view it takes

value="[{" 

and closes ol's opening tag with

id">

and rest of the information in value field just floats.

""514aede7", "label"=>"document"}, {"id"=>"3a55e040", "label"=>"license"}]">"

Can someone help me understand whats the root cause of this as I was not having same problem with rails 3.0 and ruby 1.8

Upvotes: 0

Views: 1244

Answers (1)

Arjan
Arjan

Reputation: 6274

Try "<ol #{raw(options)}></ol>"

Upvotes: 1

Related Questions