Sha256: 8ef4482602e0fc3dda704ecaf2d3dcf20cb3000b74492ba370531b50424b12ae

Contents?: true

Size: 780 Bytes

Versions: 40

Compression:

Stored size: 780 Bytes

Contents

require "action_view"

# hackety hack
module Jets::UrlHelper
  include Jets::CommonMethods

  # Basic implementation of url_for to allow use helpers without routes existence
  def url_for(options = nil) # :nodoc:
    url = case options
          when String
            options
          when :back
            _back_url
          # TODO: hook this up to Jets implmentation of config/routes.rb
          # when ActiveRecord::Base
          #   record = options
          #   record.id
          else
            raise ArgumentError, "Please provided a String to link_to as the the second argument. The Jets link_to helper takes as the second argument."
          end

    url = add_stage_name(url)
    url
  end
end # UrlHelper
ActionView::Helpers.send(:include, Jets::UrlHelper)

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
jets-0.9.1 lib/jets/rails_overrides/url_helper.rb
jets-0.9.0 lib/jets/rails_overrides/url_helper.rb
jets-0.8.18 lib/jets/rails_overrides/url_helper.rb
jets-0.8.17 lib/jets/rails_overrides/url_helper.rb
jets-0.8.15 lib/jets/rails_overrides/url_helper.rb
jets-0.8.14 lib/jets/rails_overrides/url_helper.rb
jets-0.8.13 lib/jets/rails_overrides/url_helper.rb
jets-0.8.12 lib/jets/rails_overrides/url_helper.rb
jets-0.8.11 lib/jets/rails_overrides/url_helper.rb
jets-0.8.10 lib/jets/rails_overrides/url_helper.rb
jets-0.8.9 lib/jets/rails_overrides/url_helper.rb
jets-0.8.8 lib/jets/rails_overrides/url_helper.rb
jets-0.8.6 lib/jets/rails_overrides/url_helper.rb
jets-0.8.5 lib/jets/rails_overrides/url_helper.rb
jets-0.8.4 lib/jets/rails_overrides/url_helper.rb
jets-0.8.3 lib/jets/rails_overrides/url_helper.rb
jets-0.8.2 lib/jets/rails_overrides/url_helper.rb
jets-0.8.1 lib/jets/rails_overrides/url_helper.rb
jets-0.8.0 lib/jets/rails_overrides/url_helper.rb
jets-0.7.1 lib/jets/rails_overrides/url_helper.rb