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| %> +'<label>'+ <%= doc.name %>+' </label>'+ <% end %> );
Ajax file
$.ajax({
type: "POST",
data: dataString,
datatype: "json",
success: function(response){
//.html
}
});
}