Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# HAML view
= f.text_area :javascript, :description => "Javascript typed here will come out in this page's javascript's section.", :rows => 20, :cols => 50, 'data-bespinoptions' => %q({ "syntax": "js" }).html_safe
# Output
<textarea cols="50" data-bespinoptions="{ &quot;syntax&quot;: &quot;js&quot; }" description="Javascript typed here will come out in this page's javascript's section." id="page_javascript" name="page[javascript]" rows="20"></textarea>
@ramontayag

This comment has been minimized.

Copy link
Owner Author

ramontayag commented Oct 6, 2010

I tried

%q({ "syntax": "js" }).html_safe

just to make sure too. Same effect.

@ramontayag

This comment has been minimized.

Copy link
Owner Author

ramontayag commented Oct 6, 2010

=raw f.text_area :javascript, :description => "Javascript typed here will come out in this page's javascript's section.", :rows => 20, :cols => 50, 'data-bespinoptions' => %Q({ "syntax": "js" })

outputs the same thing too. Let me try an html.erb file to see if it's haml that's causing the problem :o

@ramontayag

This comment has been minimized.

Copy link
Owner Author

ramontayag commented Oct 9, 2010

FYI: Rails 2.3.8, I've tried with and without rails-xss (thus the .html_safe and raw code up there), in both erb and haml templates.

@ramontayag

This comment has been minimized.

Copy link
Owner Author

ramontayag commented Oct 9, 2010

Oh, and yes, in case you know bespin, I know that { "syntax": "js" } is incomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.