Issue in getting a pop up

R

Ravi Dhanekula

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.

Attachments:
http://www.ruby-forum.com/attachment/4696/test.rhtml.txt
 
B

Brian Candler

Ravi said:
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

<a href="/employees/123" target="_employee">123</a>

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

Ravi dk

Brian said:
That's a HTML question, not a Ruby one. But you could try

<a href="/employees/123" target="_employee">123</a>

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.
 
B

Brian Candler

Ravi said:
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| %>
<tr>
<td><%= row[0] %></td>
<td><%= row[1] %></td>
<td>etc</td>
</tr>
<% 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:

<td><%=h row[0] %></td>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top