Ruby on Rails
Tuesday, June 26, 2012
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",
url: "http://127.0.0.1:3000/users/searchskill",
data: dataString,
datatype: "json",
success: function(response){
//.html
}
});
}
-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/I9b05S1LspMJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment