Link_to_remote with image_tag using Paperclip

I am creating a layout of images with links.

In Photo model:

has_attached_file :mainimg, :styles => {:original =>
“465x365”, :thumb => “80x70”}

In my Front controller:

def index
@photos = Photo.find(:all)
@photos = Photo.paginate :per_page => 28, :page => params[:page]
end

In index.dryml:

<% outer = ‘a’ %>
<% inner = 1 %>
<% @photos.in_groups_of(7).each do |photorow| %>


<% photorow.each do |photo| %>

<% link_to_remote (image_tag(photo.mainimg.url(:thumb)),
:url => {:action => ‘projects/show’, :id => ‘#
{photo.project_id}’}) if photo.mainimg? %>
<% inner += 1 %> <% end %>
<% outer = outer.succ %> <% end %> <%= will_paginate @photos, :page_links => false %>

Evidently image_tag(photo.mainimg.url(:thumb) is not right, but being
a novice not sure where I am
going wrong.

Thanks,

Jet

Hi Jet Thompson

I have not used Paperclip. But an example usage of
link_to_remote+image_tag is

link_to_remote (image_tag("/images/cancel.png", {:alt => ‘Cancel’,
:class=>“classhere”,:title=>“Cancel”}),{:url => { :action =>
‘projects/show’, :id => “#{photo.project_id}”}})

Sijo