li.links = link_to ccn.name, '#', :class => 'symptom_link grey', :id => "symptom-#{ccn.id}" javascript: jQuery(function() { jQuery(".symptom_link").click(function() { jQuery.ajax("/symptom/update_possible_causes/#{ccn.name.gsub(/\s/, '-').downcase}"); }); });