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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---