Passing parameter to open dialog using link_to_function

Hello all,
I’m having one fun time trying to past a parameter to a javascript
function using link_to_function.

This is what I have…

  1. A simple project, controller, views, model.
  2. Prototype Window dialog box installed.

What I’m trying to do is on the index.html.erb, instead of link_to
“show”, project I’m using link_to_function “Show”, "project.show()’.
I want to past the project.id to project.show(). If I do
project.show(project.id), it blows up.

  • index.html.erb -

<%= javascript_tag(“project = new Window({
className: ‘alphacube’,
title: ‘Project Details’,
width:400,
height:400,
top:70,
left:600
});
project.getContent().update(’

foo bar
');”
) %> <% projects.each do |project| %> <% end %>
CTSI Project DB
Project ID IRB ID Title Pi full name Action
<%=h project.project_id %> <%=h project.irb_id %> <%=h truncate( project.title, :length => 20 ) %> <%=h project.pi_full_name %> <%= link_to_function 'View', 'project.show()' %>

Any help will be greatly appreciated.

JohnM

I removed the Prototype window and went will jQuery UI Dialog instead.
It was easier to work with and more examples in regards to what I’m
trying to accomplish.

JohnM

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs