how to give controller return value into jquery.html()

here this

format.json { render :json => @cnames }

from the controller searchskill. this @cnames is a hash, so how to give each value from that @cnames using itetrate in .html()

can i give anything like this…

**like this $(’.searchmodal’).( <%= @cnames .each do |doc| %> +’’+ <%= doc.name %>+’ '+ <% end %> ); **

Ajax file

$.ajax({

type: “POST”,

url: “http://127.0.0.1:3000/users/searchskill”,

data: dataString,

datatype: “json”,

success: function(response){

//.html

}

});

}