Sha256: 40b5267ffa39ce17f4d6a46b78f977e7062d35bfe9eed0e6e674ccd7958ee7ec

Contents?: true

Size: 818 Bytes

Versions: 17

Compression:

Stored size: 818 Bytes

Contents

module PictureFilesHelper
  def show_image(picture_file, options = {size: :medium})
    case options[:size]
    when :medium
      if picture_file.picture.width.to_i >= 600
        return image_tag picture_file_path(picture_file, format: :download, size: :medium), alt: "*", width: picture_file.picture.width(:medium), height: picture_file.picture.height(:medium)
      end
    when :thumb
      if picture_file.picture.width.to_i >= 100
        return image_tag picture_file_path(picture_file, format: :download, size: :thumb), alt: "*", width: picture_file.picture.width(:thumb), height: picture_file.picture.height(:thumb)
      end
    end
    image_tag picture_file_path(picture_file, format: :download, size: :original), alt: "*", width: picture_file.picture.width, height: picture_file.picture.height
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
enju_biblio-0.2.0.beta.1 app/helpers/picture_files_helper.rb
enju_biblio-0.1.3 app/helpers/picture_files_helper.rb
enju_biblio-0.1.2 app/helpers/picture_files_helper.rb
enju_biblio-0.1.1 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre71 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre70 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre69 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre68 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre67 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre66 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre65 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre64 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre63 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre62 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre61 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre60 app/helpers/picture_files_helper.rb