Sha256: 059b7438668570a4b801d6495d61d3dfda5d53d5e18e9880530e66abd1555cee

Contents?: true

Size: 409 Bytes

Versions: 2

Compression:

Stored size: 409 Bytes

Contents

module MobileEnhancements
  module UrlHelper
    def url_for(*args)
      # ignore our direct calls for desktop/mobile URLs
      if args.size == 1 && args.first.frozen?
        super
      # if it's from a mobile
      elsif mobile_request?
        # mobilify the url
        mobile_url(super)
      # if it's a desktop request
      else
        # process as normal
        super
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mobile-enhancements-0.0.4 lib/mobile_enhancements/url_helper.rb
mobile-enhancements-0.0.3 lib/mobile_enhancements/url_helper.rb