Created
April 29, 2013 21:24
-
-
Save karmiclychee/5484916 to your computer and use it in GitHub Desktop.
re: gal_background local variable. If the gallery item has an image attached, then it's the gal_background, otherwise, it's the placeholder image. Currently, gal_background is set, and the gallery iterator uses it to define "style: background-image: url(?)"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ul.thumbnails | |
- gallery.each do |gallery_item| | |
%li{ class: "span8", id: "#{new_sibling}_#{gallery_item.id}" } | |
- if gallery_item.image | |
- gal_background = "background-image: url(#{gallery_item.image.url(:gallery)})" | |
- else | |
- gal_background = "background-image: url('/assets/empty.jpg')" | |
%div{ style: gal_background , class: "cutter thumbnail" } | |
%h1 | |
= link_to gallery_item.name, [parent, gallery_item] | |
%small | |
= "#{gallery_item.description}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment