Module: Releaf::ActionController::RichtextAttachments

Extended by:
ActiveSupport::Concern
Included in:
Releaf::ActionController
Defined in:
app/lib/releaf/action_controller/richtext_attachments.rb

Instance Method Summary collapse

Instance Method Details

#create_releaf_richtext_attachmentObject



16
17
18
19
# File 'app/lib/releaf/action_controller/richtext_attachments.rb', line 16

def create_releaf_richtext_attachment
  return unless params[:upload]
  @resource = Releaf::RichtextAttachment.create!(file_type: params[:upload].content_type, file: params[:upload])
end

#releaf_richtext_attachment_upload_urlObject



8
9
10
11
12
13
14
# File 'app/lib/releaf/action_controller/richtext_attachments.rb', line 8

def releaf_richtext_attachment_upload_url
  begin
    url_for(action: :create_releaf_richtext_attachment)
  rescue ::ActionController::UrlGenerationError
    nil
  end
end