Sha256: 2608a715a056b99089a86f75a5d05df989684120ad2e1f2ffe3728d0ff0ce801

Contents?: true

Size: 766 Bytes

Versions: 128

Compression:

Stored size: 766 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

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

Version data entries

128 entries across 128 versions & 3 rubygems

Version Path
jets_bb_fork-0.0.4 lib/jets/overrides/rails/url_helper.rb
jets-1.9.32 lib/jets/overrides/rails/url_helper.rb
jets-1.9.31 lib/jets/overrides/rails/url_helper.rb
jets-1.9.30 lib/jets/overrides/rails/url_helper.rb
jets-1.9.29 lib/jets/overrides/rails/url_helper.rb
jets-1.9.28 lib/jets/overrides/rails/url_helper.rb
jets-1.9.27 lib/jets/overrides/rails/url_helper.rb
jets-1.9.26 lib/jets/overrides/rails/url_helper.rb
jets-1.9.25 lib/jets/overrides/rails/url_helper.rb
jets-1.9.24 lib/jets/overrides/rails/url_helper.rb
jets-1.9.23 lib/jets/overrides/rails/url_helper.rb
jets-1.9.22 lib/jets/overrides/rails/url_helper.rb
jets-1.9.21 lib/jets/overrides/rails/url_helper.rb
jets-1.9.20 lib/jets/overrides/rails/url_helper.rb
jets-1.9.19 lib/jets/overrides/rails/url_helper.rb
jets-1.9.18 lib/jets/overrides/rails/url_helper.rb
jets-1.9.17 lib/jets/overrides/rails/url_helper.rb
jets-1.9.16 lib/jets/overrides/rails/url_helper.rb
jets-1.9.15 lib/jets/overrides/rails/url_helper.rb
jets-1.9.14 lib/jets/overrides/rails/url_helper.rb