Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save patrickberkeley/41037 to your computer and use it in GitHub Desktop.

Select an option

Save patrickberkeley/41037 to your computer and use it in GitHub Desktop.
<%= project.images.first ? (link_to_remote (image_tag project.images.first.file.url(:thumb), :title => truncate(project.description)), :url => {:controller => :projects, :action => :change_main, :category_id => category, :project_id => project.id}, :loading => "$('category_#{category.id}_main').hide(); $('spinner').show();", :update => "category_#{category.id}_main", :complete => "$('spinner').hide(); $('category_#{category.id}_main').show(); Shadowbox.clearCache(); Shadowbox.setup();" ) : "" %>
<%= project.images.first ? ("<a href='#{project.images.first.file.url}' title='#{project.title}' rel='shadowbox'>" + (image_tag project.images.first.file.url(:medium), :title => 'Click to enlarge.') + "</a>") : "" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment