Sha256: 4461f76f4776e28d72bc1b90c8367097b889f403667f09e37e12272e77a9f65c

Contents?: true

Size: 866 Bytes

Versions: 68

Compression:

Stored size: 866 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

68 entries across 68 versions & 1 rubygems

Version Path
enju_biblio-0.1.0.pre59 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre58 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre57 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre56 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre55 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre54 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre53 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre52 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre51 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre50 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre49 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre48 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre47 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre46 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre45 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre44 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre43 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre42 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre41 app/helpers/picture_files_helper.rb
enju_biblio-0.1.0.pre40 app/helpers/picture_files_helper.rb