Sha256: 38aee8553a945d086db04b449556bb85e321827756c12cadd6254fd9f108ca92

Contents?: true

Size: 496 Bytes

Versions: 1

Compression:

Stored size: 496 Bytes

Contents

require "uri"

module RailsImager::ImagesHelper
  def rails_imager_p(path, args = {})
    newpath = "/rails_imager/images/"
    newpath << URI.encode(path)
    newpath << "/?"
    
    first = true
    args.each do |key, val|
      if first
        first = false
      else
        newpath << "&"
      end
      
      realkey = "image[#{key}]"
      
      newpath << URI.encode(realkey.to_s)
      newpath << "="
      newpath << URI.encode(val.to_s)
    end
    
    return newpath
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_imager-0.0.11 app/helpers/rails_imager/images_helper.rb