Sha256: 3f270ae430daf23c2c5872e63aa4922e7445923a4fa0a251dab2265325354365

Contents?: true

Size: 382 Bytes

Versions: 17

Compression:

Stored size: 382 Bytes

Contents

module HolderRails
  module Helpers
    def holder_tag(size, text='', theme=nil, html_options={})
      size = "#{size}x#{size}" unless size =~ /\A\d+%?x\d+\z/
      text = text.to_s.empty? ? size : text
      options = {:src => '', :data => {:src => "holder.js/#{size}/text:#{text}/#{theme}"}}
      options = options.merge(html_options)

      tag :img, options
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
holder_rails-2.8.0 lib/holder_rails/helpers.rb
holder_rails-2.7.1 lib/holder_rails/helpers.rb
holder_rails-2.6.1 lib/holder_rails/helpers.rb
holder_rails-2.7.0 lib/holder_rails/helpers.rb
holder_rails-2.6.0 lib/holder_rails/helpers.rb
holder_rails-2.5.2 lib/holder_rails/helpers.rb
holder_rails-2.5.0 lib/holder_rails/helpers.rb
holder_rails-2.4.1 lib/holder_rails/helpers.rb
holder_rails-2.4.0 lib/holder_rails/helpers.rb
holder_rails-2.3.2 lib/holder_rails/helpers.rb
holder_rails-2.3.1 lib/holder_rails/helpers.rb
holder_rails-2.3.0 lib/holder_rails/helpers.rb
holder_rails-2.2.0 lib/holder_rails/helpers.rb
holder_rails-2.1.0 lib/holder_rails/helpers.rb
holder_rails-2.0.0 lib/holder_rails/helpers.rb
holder_rails-1.9.0 lib/holder_rails/helpers.rb
holder_rails-1.7.0 lib/holder_rails/helpers.rb