# Issue in getting a pop up

**URL:** <https://www.ruby-forum.com/t/issue-in-getting-a-pop-up/187644>\
**Category:** Ruby\
**Created:** [April 27, 2010, 11:21am UTC](https://www.ruby-forum.com/t/issue-in-getting-a-pop-up/187644 "2010-04-27T11:21:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@drk](https://www.ruby-forum.com/u/drk)\
**Post date:** [April 27, 2010, 11:21am UTC](https://www.ruby-forum.com/t/issue-in-getting-a-pop-up/187644/1 "2010-04-27T11:21:28Z")

</div>

I haave an employee data in an oracle table.It contains the columns  
employee\_name,Employee\_surname,XML\_info\_of\_emloyee.  
I am pulling the data to show in a windows report. And i want to show  
employee name and surname of all the employees and the XML info as a pop  
up when i click on Employee name or surname or a temporary field XML in  
the window page.

I have prepared the ruby code to pull the data and display. The code  
inputs all the columns to teh front end report. Need help in modifying  
the code such that the XML info of each employee appears as a pop-up  
whenever i click on the employee name. I am attaching the code here  
with.

---

<div class="post-metadata">

**Author:** ![drk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@drk](https://www.ruby-forum.com/u/drk)\
**Post date:** [April 27, 2010, 12:05pm UTC](https://www.ruby-forum.com/t/issue-in-getting-a-pop-up/187644/2 "2010-04-27T12:05:01Z")

</div>

Ravi dk wrote:

> I haave an employee data in an oracle table.It contains the columns  
> employee\_name,Employee\_surname,XML\_info\_of\_emloyee.  
> I am pulling the data to show in a windows report. And i want to show  
> employee name and surname of all the employees and the XML info as a pop  
> up when i click on Employee name or surname or a temporary field XML in  
> the window page.
> 
> I have prepared the ruby code to pull the data and display. The code  
> inputs all the columns to teh front end report. Need help in modifying  
> the code such that the XML info of each employee appears as a pop-up  
> whenever i click on the employee name. I am attaching the code here  
> with.

That’s a HTML question, not a Ruby one. But you could try

[123](https://www.ruby-forum.com/employees/123)

or you could use Javascript with AJAX (e.g. jQuery)

---

<div class="post-metadata">

**Author:** ![drk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@drk](https://www.ruby-forum.com/u/drk)\
**Post date:** [April 28, 2010, 10:29am UTC](https://www.ruby-forum.com/t/issue-in-getting-a-pop-up/187644/3 "2010-04-28T10:29:22Z")

</div>

Ravi dk wrote:

> Here i am using all.each{|row| to consider all the rows and columns for  
> the final report. Please let me know the alternative so that i have to  
> print only 2 columns out of 3(let`s say) and entire number of rows.

\<% all.each do |row| %\>

 \<%= row[0] %\> \<%= row[1] %\> etc \<% end %\>

You are currently using row.join(“sep”) which joins all the array  
elements together.

If ‘all’ is an Array of Arrays, then the total number of rows is \<%=  
all.size %\>

Note that you should be HTML-escaping the values before inserting them  
into the page (consider what happens if row[0] contains \< or &).

To keep the templates simple you could define a helper method ‘h’ like  
Rails does. Then you’d use it like this:

 \<%=h row[0] %\>

---

<div class="post-metadata">

**Author:** ![drk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b5ac83/32.png) [@drk](https://www.ruby-forum.com/u/drk)\
**Post date:** [April 28, 2010, 7:45am UTC](https://www.ruby-forum.com/t/issue-in-getting-a-pop-up/187644/4 "2010-04-28T07:45:12Z")

</div>

Brian C. wrote:

> > 
> 
> That’s a HTML question, not a Ruby one. But you could try
> 
> [123](https://www.ruby-forum.com/employees/123)
> 
> or you could use Javascript with AJAX (e.g. jQuery)

Hi Brian , Thanks for the reply. Can you please help me with the rubu  
part fo the script.  
Here i am using all.each{|row| to consider all the rows and columns for  
the final report. Please let me know the alternative so that i have to  
print only 2 columns out of 3(let`s say) and entire number of rows.
