Sha256: 4686c23e240ed3495339ca8d3ab7a51461e037f4ff437b50f605200df4476518

Contents?: true

Size: 355 Bytes

Versions: 4

Compression:

Stored size: 355 Bytes

Contents

module Shortener::ShortenerHelper

  # generate a url from a url string
  def short_url(url, owner: nil, custom_key: nil)
    short_url = Shortener::ShortenedUrl.generate(url, owner: owner, custom_key: custom_key)
    short_url ? url_for(controller: :"shortener/shortened_urls", action: :show, id: short_url.unique_key, only_path: false) : url
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shortener-0.5.3 app/helpers/shortener/shortener_helper.rb
shortener-0.5.2 app/helpers/shortener/shortener_helper.rb
shortener-0.5.1 app/helpers/shortener/shortener_helper.rb
shortener-0.5.0 app/helpers/shortener/shortener_helper.rb