Skip to content

Instantly share code, notes, and snippets.

View gedankenstuecke's full-sized avatar
🥽
Doing Research

Bastian Greshake Tzovaras gedankenstuecke

🥽
Doing Research
View GitHub Profile
@gedankenstuecke
gedankenstuecke / _edit.html.erb
Created September 11, 2011 14:26 — forked from scy/_edit.html.erb
Initializing a jQuery UI autocomplete with data from a Rails array
<script type="text/javascript">
// Trying to help @gedankenstuecke here. A bit hard because I don’t speak Rails (neither Ruby) and can’t try live what the output looks like.
$(function () {
$("#<%=p.object.phenotype_id.to_json%>").autocomplete({
source: <%=raw(Phenotype.find_by_id(p.object.phenotype_id).known_phenotypes.to_json)%>
});
});
</script>