Sha256: e74c31c1250bed189c822f38ebfc263be0f5cf9c80dbef33ef416186b7c7b13b

Contents?: true

Size: 607 Bytes

Versions: 8

Compression:

Stored size: 607 Bytes

Contents

module BrickLayer::ViewHelper
  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
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
brick_layer-0.10.6 app/helpers/brick_layer/view_helper.rb
brick_layer-0.10.5 app/helpers/brick_layer/view_helper.rb
brick_layer-0.10.3 app/helpers/brick_layer/view_helper.rb
brick_layer-0.10.2 app/helpers/brick_layer/view_helper.rb
brick_layer-0.10.1 app/helpers/brick_layer/view_helper.rb
brick_layer-0.10.0 app/helpers/brick_layer/view_helper.rb
brick_layer-0.9.6 app/helpers/brick_layer/view_helper.rb
brick_layer-0.9.4 app/helpers/brick_layer/view_helper.rb