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| %>
<div id="<%= outer %>">
<% photorow.each do |photo| %>
<div id="<%= inner %>">
<% link_to_remote (image_tag(photo.mainimg.url(:thumb)),
:url => {:action => ''projects/show'', :id
=> ''#
{photo.project_id}''}) if photo.mainimg? %>
</div>
<% inner += 1 %>
<% end %>
</div>
<% 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