Newbie - Rails 3 lightbox?

Anders_P
Fri, 15 Oct 2010 15:24:57 -0000

Hello!

I''m trying to create a simple image "popup" effect using
Lightbox2,
http://www.huddletogether.com/projects/lightbox2/. But I don''t get it
to work. My code looks lite this:


  <a href="<%= ad.image.url(:thumb) %>"
rel="lightbox"><img src="<%ad.image.url(:thumb)
%>" />


This generates:


  <a
href="/system/images/301/thumb/tufftroja_19225958.jpg?1287075644"
rel="lightbox"><img src="/system/images/301/thumb/
tufftroja_19225958.jpg?
1287075644" />


And in my application.html.erb

<%= render ''layouts/stylesheets'' %>
<%= stylesheet_link_tag ''lightbox'' %>
<%= javascript_include_tag :defaults, ''lightbox'' %>

The image shows up, but nothing happens when I click on it.

Any suggestions on what I''m doing wrong would be appreciated!

Thanks!
// Anders