I am created Rail application with erb views. I want to use some JS code with in ruby code like following
<script>
$('#select-service').click(function() {
var service='<%= Service.find("this.id") %>';
});
</script>
I want to query based on user selected value. How to replace "this.id" used above and how to insert js code instead of "this.id" ?