Class: Envoy::PanelsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/envoy/panels_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST, not GET behind a lazy frame: this creates a record. The semantics genuinely are "create or resume", so one path serves open and reopen and a reopen always re-fetches a current transcript.



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/envoy/panels_controller.rb', line 6

def create
  surface = Envoy.surface(params.require(:surface))
  conversation = find_or_resume(surface)
  render partial: "envoy/panels/panel", locals: { conversation: conversation }
rescue Envoy::UnknownSurface
  # surface and context_key arrive from the browser; only registered
  # surfaces are addressable. Whether this ACTOR may see this SUBJECT is the
  # surface's context block to enforce.
  head :not_found
end