Sha256: 7bf313b5cc15a2da5dae98b7a1f2fab3c2c188c608c51703ed30d53fea9fed54

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

require 'view_opener/current'

module ViewOpener
  class Subscriber < ActiveSupport::Subscriber
    def render_template(event)
      Current.views << event.payload[:identifier]
      if event.payload[:layout].present?
        # TODO: guess of extension
        # Current.views << Rails.root.join('app', 'views', event.payload[:layout])
      end
    end

    def render_partial(event)
      Current.views << event.payload[:identifier]
    end

    def render_collection(event)
      Current.views << event.payload[:identifier]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
view_opener-0.1.0 lib/view_opener/subscriber.rb