Class: FroalaEditorSDK::Image

Inherits:
File
  • Object
show all
Defined in:
lib/froala-editor-sdk/image.rb

Overview

Image functionality.

Class Method Summary collapse

Methods inherited from File

delete, resize, save, upload, #var

Class Method Details

.load_images(path, options = {}) ⇒ Object

Loads the images from a specific path Params:

path

The server path where the images are saved

Returns Json object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/froala-editor-sdk/image.rb', line 23

def self.load_images(path, options = {})

  # Merge options.
  options = @default_options.merge(options)

  images = Dir["#{path}*"]
  all_images = []

  images.each do |img|
    all_images.push({url: "#{options[:file_access_path]}#{Utils.get_file_name(img)}"})
  end

  return all_images.to_json
end