Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8770859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:38:38+00:00 2026-06-13T17:38:38+00:00

My code in controller looks like this: def dashboard @proj_users.each do |us| @users<<User.find(us.user_id).email end

  • 0

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
tm@gmail.com,tm2@gmail.com

$("#proj_users").html(data); is not getting updated with data..

Kindly help me..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:38:39+00:00Added an answer on June 13, 2026 at 5:38 pm
    two ways
    

    1) solution 1

      @proj_users.each do |us|
         email  = User.find(us.user_id).email + "<br>"
         @users << email
       end
       render :text=>@users
    

    2) solution 2

      @proj_users.each do |us|
         @users<<User.find(us.user_id).email
       end
       render :json=>@users
    
       in view
    
       $(".clicked").click(function(){
            $.get("/dashboard",{
            clicked_id:this.id,
            user:$("#user").val()
            },
            function(data)
            {
             $("#all_users").hide();
             $.each(data, function(email){
               $("#proj_users").append(email + "<br>");
             }
            });
       });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My helper code looks like this (and works fine btw): module ProvidersHelper def call_to_review(provider)
My code looks something like this class MyController def my_action #params hash gets passed
I'm try something from this comment idea Code Igniter Controller/Model name conflicts find class
Let's say my controller looks like this: class MyController < ApplicationController before_filter :find_user,:only =>
So I have an observer which looks like this: class RecipeObserver < Mongoid::Observer def
I'm currently developing a gem that handles mobile devices. The controller looks like this:
1) The controller code (Symfony2 framework): $em = $this->getDoctrine()->getEntityManager(); // get latest toplist $last
I keep getting this error: uninitialized constant GetxmlController::Xmlparse my code for the class looks
I have a model called Action. It looks like this: class Action < ActiveRecord::Base
I need to know how to test this controller action def create_mobile if mobile_user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.