Sha256: e973782902d828d386172916f56ae03800c8c44e67196363f53f4161d1cedf38

Contents?: true

Size: 622 Bytes

Versions: 82

Compression:

Stored size: 622 Bytes

Contents

module Jets::Router::Helpers
  module CoreHelper
    extend ActiveSupport::Concern

    # Used for form_for helper
    def polymorphic_path(record, _)
      url_for(record)
    end

    # override helper delegates to point to jets controller
    # TODO: params is weird
    CONTROLLER_DELEGATES = %w[session response headers]
    CONTROLLER_DELEGATES.each do |meth|
      define_method meth do
        @_jets[:controller].send(meth)
      end
    end

    class_methods do
      def define_helper_method(name)
        define_method(name) do
          @_jets[:controller].send(name)
        end
      end
    end
  end
end

Version data entries

82 entries across 82 versions & 2 rubygems

Version Path
jets-3.0.6 lib/jets/router/helpers/core_helper.rb
jets-3.0.5 lib/jets/router/helpers/core_helper.rb
jets-3.0.4 lib/jets/router/helpers/core_helper.rb
jets-3.0.3 lib/jets/router/helpers/core_helper.rb
jets-2.3.19 lib/jets/router/helpers/core_helper.rb
jets-3.0.2 lib/jets/router/helpers/core_helper.rb
jets-3.0.1 lib/jets/router/helpers/core_helper.rb
jets-3.0.0 lib/jets/router/helpers/core_helper.rb
jets-2.3.18 lib/jets/router/helpers/core_helper.rb
jets-2.3.17 lib/jets/router/helpers/core_helper.rb
jets-2.3.16 lib/jets/router/helpers/core_helper.rb
jets-2.3.15 lib/jets/router/helpers/core_helper.rb
jets-2.3.14 lib/jets/router/helpers/core_helper.rb
jets-2.3.13 lib/jets/router/helpers/core_helper.rb
jets-2.3.12 lib/jets/router/helpers/core_helper.rb
jets-2.3.11 lib/jets/router/helpers/core_helper.rb
jets-2.3.10 lib/jets/router/helpers/core_helper.rb
jets-2.3.9 lib/jets/router/helpers/core_helper.rb
jets-2.3.8 lib/jets/router/helpers/core_helper.rb
jets-2.3.7 lib/jets/router/helpers/core_helper.rb