Kylo
Kylo

Reputation: 2320

How to block javascript evaluation during updating a page

I am updating a page through AJAX using .rjs template. Is there any way to block evaluating javascript in rendered content (something like :script => false for link_to_remote)?

My update.rjs looks pretty much like this:

page.replace_html 'some_div', :partial => 'partial_with_js', :collection => @list
page.insert_html ...
(etc.)

Upvotes: 0

Views: 109

Answers (1)

Eugene Ramirez
Eugene Ramirez

Reputation: 3123

One way is to wrap your javascript in string, then just eval it after load.

Upvotes: 1

Related Questions