Not escaping arguments passed on to view helpers

I have a json formatted arg that I pass to a view helper, but the HTML
gets escaped. I need it not to. I’m on Rails 2.3.6=8, I’ve tried using
rails_xss and using raw and html_safe but it doesn’t make a
difference. How do I not escape the argument? See
http://gist.github.com/613780 for more details.

Thanks!
Ramon T.

On Oct 9, 10:43 am, Ramon T. [email protected] wrote:

I have a json formatted arg that I pass to a view helper, but the HTML
gets escaped. I need it not to. I’m on Rails 2.3.6=8, I’ve tried using
rails_xss and using raw and html_safe but it doesn’t make a
difference. How do I not escape the argument? Seehttp://gist.github.com/613780for more details.

I think the html safe mostly worries about < and > and so on.
Looking at your example it looks like the correct thing is happening -
if those quotes marks weren’t escaped you’d have

<textarea cols=“50” data-bespinoptions="{ “syntax”: “js” }"

which isn’t right.

Fred

Yes, that wouldn’t be, but how about:

<textarea cols=“50” data-bespinoptions=’{ “syntax”: “js” }’

Ramon T.

On Sat, Oct 9, 2010 at 5:49 PM, Frederick C.
<[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs