2
3
4
5
6
7
8
9
10
11
12
13
|
# File 'app/helpers/brick_layer/view_helper.rb', line 2
def list_of_sizes_for(data_set, image_attribute)
if data_set.class.custom_field_options && data_set.class.custom_field_options[image_attribute.to_sym]
sizes = data_set.class.custom_field_options[image_attribute.to_sym][:sizes]
if !sizes.blank?
html = ""
sizes.each do |k,v|
html += content_tag(:li, link_to("#{k.to_s.titlecase} #{image_attribute.titlecase}", data_set.send(image_attribute).thumb(v).url, { :target => "_blank"}))
end
content_tag(:ul, raw(html), { :class => "image-links"} )
end
end
end
|