I have the following js (in a string literal) returned in one of my plugin's methods. So when I call the method it puts this in my view. The problem is on the website, all the <, ", ', > etc are escaped into <, " and whatnot. How can I do this? I've tried various ways but none seem to work :/ I think this plugin may be kind of old so this was possible in earlier versions of Rails...
%Q{<script type="text/javascript">
$(function() {
$('#{table_dom_id}').dataTable({
"oLanguage": {
"sSearch": "#{search_label}",
#{"'sZeroRecords': '#{no_records_message}'," if no_records_message}
"sProcessing": '#{processing}'
},
"sPaginationType": "full_numbers",
"iDisplayLength": #{per_page},
"bProcessing": true,
"bServerSide": #{server_side},
"bLengthChange": false,
"bStateSave": #{persist_state},
"bFilter": #{search},
"bAutoWidth": #{auto_width},
#{"'aaSorting': [#{sort_by}]," if sort_by}
#{"'sAjaxSource': '#{ajax_source}'," if ajax_source}
"aoColumns": [
#{formatted_columns(columns)}
],
#{"'fnRowCallback': function( nRow, aData, iDisplayIndex ) { #{row_callback} }," if row_callback}
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( #{additional_data_string} );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json);
} );
}
})#{append};
});
</script>}
Any help is appreciated, thanks!