Module: Upjs::Rails::InspectorAccessor

Defined in:
lib/upjs/rails/inspector_accessor.rb

Overview

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?".

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
# File 'lib/upjs/rails/inspector_accessor.rb', line 9

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

Instance Method Details

#upObject



13
14
15
# File 'lib/upjs/rails/inspector_accessor.rb', line 13

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

#up?Object

:method: up? Returns whether the current request is an page fragment update triggered by an Up.js frontend.



22
# File 'lib/upjs/rails/inspector_accessor.rb', line 22

delegate :up?, :to => :up