Created
October 20, 2010 16:02
-
-
Save dumbledore/636705 to your computer and use it in GitHub Desktop.
Example for using html_safe in Rails 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= stylesheet_link_tag 'suggest.min' %> | |
<%= javascript_include_tag 'jquery.min' %> | |
<%= javascript_include_tag 'suggest.min' %> | |
<script type="text/javascript"> | |
$(function() { | |
$("#<%= @search_field %>") | |
.suggest({ | |
"type": "<%= @type_info %>" | |
<%= ", \"mql_filter\": [{#{h(@mql_filter)}}]".html_safe unless @mql_filter.nil? %> | |
}) | |
.bind("fb-select", function(e, data) { | |
document.getElementById('<%= @freebase_field %>').value = data.id; | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment