I have this dropdown list
<div class="field">
<%= f.collection_select :semester_id, Semester.all, :id, :name %><br />
</div>
This create id registration_semester_id
When someone select an option I have to take that value do some calculation with jquery like below
<script type="text/javascript">
$('document').ready(function(){
$("#registration_semester_id").click(function(){
// here I have to do something like this
/*
@subject.each do |subject|
if subject.semester_id == value
<%= check_box_tag "checkboxs[]", subject.semester_id %>
<%= subject.name %>
end
*/
//alert("working");
});
});
</script>
I have a table subjects and it has two column name and semester_id. Please let me know how can I do this?