My code in controller looks like this:
def dashboard
@proj_users.each do |us|
@users<<User.find(us.user_id).email
end
render :json=>@users
end
In my view page the javascript looks like this:
$(".clicked").click(function () {
$.get("/dashboard", {
clicked_id:this.id,
user:$("#user").val()
},
function (data) {
$("#all_users").hide();
$("#proj_users").html(data);
});
});
@users is an array containing email id. as you can see the data will have @users.
@users will be something like this
[email protected],[email protected]
$("#proj_users").html(data); is not getting updated with data..
Kindly help me..