Class: Plain::DocumentsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/plain/documents_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/plain/documents_controller.rb', line 11

def create
  @conversation = Conversation.find(params[:conversation_id])
  @message = @conversation.messages.find(params[:message_id])

  @document = Document.new(document_params)
  @document.content = @message.content
  if @document.save
    @docs_structure = DocsService.get_structure
  end
end

#newObject



4
5
6
7
8
9
# File 'app/controllers/plain/documents_controller.rb', line 4

def new
  @conversation = Conversation.find(params[:conversation_id])
  @message = @conversation.messages.find(params[:message_id])
  @document = Document.new
  @document.content = @message.content
end