Sha256: 77189fa151305a999ea648b8e058f4a9d3c6059ab1e41314c6429be8fce81d3d

Contents?: true

Size: 766 Bytes

Versions: 4

Compression:

Stored size: 766 Bytes

Contents

module RailsGallery
  module ViewHelper
    module Galleria
      def riagal_image photo, options = {}
        content_tag :a, href: photo.path do
          options.merge! :"data-title" => photo.title, :"data-description" => photo.description
          image_tag photo.path, options
        end
      end

      def riagal_imageset photo, options = {}
        content_tag :a, href: photo.path do
          options.merge! :"data-title" => photo.title, :"data-description" => photo.description
          options.merge! :srcset => photo.srcset if photo.srcset?
          image_tag photo.path, options
        end
      end
      alias_method :galleria_gallery_image, :riagal_image
      alias_method :galleria_gallery_imageset, :riagal_imageset      
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails-gallery-0.3.3 lib/rails-gallery/view_helper/galleria.rb
rails-gallery-0.3.2 lib/rails-gallery/view_helper/galleria.rb
rails-gallery-0.3.1 lib/rails-gallery/view_helper/galleria.rb
rails-gallery-0.3.0 lib/rails-gallery/view_helper/galleria.rb