# Link in YUI js not rendered by rails

**URL:** <https://www.ruby-forum.com/t/link-in-yui-js-not-rendered-by-rails/189334>\
**Category:** Rails\
**Created:** [May 28, 2010, 10:07pm UTC](https://www.ruby-forum.com/t/link-in-yui-js-not-rendered-by-rails/189334 "2010-05-28T22:07:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick\_nicholas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a698b9/32.png) [@patrick\_nicholas](https://www.ruby-forum.com/u/patrick_nicholas)\
**Post date:** [May 28, 2010, 10:07pm UTC](https://www.ruby-forum.com/t/link-in-yui-js-not-rendered-by-rails/189334/1 "2010-05-28T22:07:23Z")

</div>

Using YAHOO.widget.treeview to generate a table with three levels of  
data: module, submodule, and detail. If there is an image associated  
with a detail row the javascript generates a link:

```
"<td><a href=\"/screenshot/show/" + rowData.id + "\">Screenshot</

```

a\>"

that is appended to the html for the row.

The url is generated correctly and the link appears. When clicked  
nothing happens except the word ‘Done’ appears in the browser status  
bar.

Am calling the very same url from another page that does not use  
javascript and the screenshot page appears as expected.

Here is the controller.

class ScreenshotController \< ApplicationController  
def show  
if @detail.screen\_path.length \> 1  
@imagePath = “#{RAILS\_ROOT}” +  
“/private/#{Company.find(@detail.company\_id).subdir}/” +  
“#{Project.find(@detail.project\_id).subdir}/screenshot/” +  
“#{@detail.screen\_path}”  
send\_file ( @imagePath, :type =\> ‘image/jpeg’, :disposition =\>  
‘inline’)  
end  
end  
end

A sample url: [http://localhost:3004/screenshot/show/20854](http://localhost:3004/screenshot/show/20854)

This code from show.html.erb belonging to the detail model works:  
\<%= link\_to ‘ **View** ’, :controller =\> ‘screenshot’, :id =\>  
@detail.id, :action =\> ‘show’ %\>

Any ideas???
