Sha256: 8c3e5dd601a4e081084648f8594f86213597cd378dfe4c50a2604d40d9e8e541

Contents?: true

Size: 709 Bytes

Versions: 8

Compression:

Stored size: 709 Bytes

Contents

module Upjs
  module Rails
    ##
    # This adds two methods `#up` and `#up?` to all controllers,
    # helpers and views, allowing the server to inspect the current request
    # for Up.js-related concerns such as "is this a page fragment update?".
    module InspectorAccessor

      def self.included(base)
        base.helper_method :up, :up?
      end

      def up
        @up_inspector ||= Inspector.new(self)
      end

      ##
      # :method: up?
      # Returns whether the current request is an
      # [page fragment update](http://upjs.io/up.replace) triggered by an
      # Up.js frontend.
      delegate :up?, :to => :up

      ActionController::Base.send(:include, self)

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
upjs-rails-0.19.0 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.18.1 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.18.0 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.17.0 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.16.0 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.15.1 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.15.0 lib/upjs/rails/inspector_accessor.rb
upjs-rails-0.14.1 lib/upjs/rails/inspector_accessor.rb