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…
- A simple project, controller, views, model.
- 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(’
) %>
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