Module: Jets::UrlHelper

Includes:
CommonMethods
Defined in:
lib/jets/overrides/rails/url_helper.rb

Overview

hackety hack

Instance Method Summary collapse

Methods included from CommonMethods

#add_stage?, #add_stage_name, #on_aws?

Instance Method Details

#url_for(options = nil) ⇒ Object

Basic implementation of url_for to allow use helpers without routes existence



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/jets/overrides/rails/url_helper.rb', line 8

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