Module: Unpoly::Rails::InspectorAccessor

Defined in:
lib/unpoly/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 Unpoly-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/unpoly/rails/inspector_accessor.rb', line 9

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

Instance Method Details

#upObject Also known as: unpoly


13
14
15
# File 'lib/unpoly/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 Unpoly frontend.


24
# File 'lib/unpoly/rails/inspector_accessor.rb', line 24

delegate :up?, :unpoly?, :to => :up