Class: Layered::Assistant::Public::Panel::ConversationsController

Inherits:
ApplicationController show all
Includes:
StoppableResponse
Defined in:
app/controllers/layered/assistant/public/panel/conversations_controller.rb

Instance Method Summary collapse

Methods included from StoppableResponse

#stop

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/layered/assistant/public/panel/conversations_controller.rb', line 19

def create
  @conversation = @assistant.conversations.new(name: Conversation.default_name)

  if @conversation.save
    add_conversation_to_session(@conversation)
    redirect_to layered_assistant.public_panel_conversation_path(@conversation)
  else
    render :new, status: :unprocessable_entity
  end
end

#indexObject



13
14
# File 'app/controllers/layered/assistant/public/panel/conversations_controller.rb', line 13

def index
end

#newObject



16
17
# File 'app/controllers/layered/assistant/public/panel/conversations_controller.rb', line 16

def new
end

#showObject



30
31
32
# File 'app/controllers/layered/assistant/public/panel/conversations_controller.rb', line 30

def show
  @messages = @conversation.messages.includes(:model).by_created_at
end