class FroalaEditorSDK::Image

Image functionality.

Public Class Methods

load_images(path, options = {}) click to toggle source

Loads the images from a specific path Params:

path

The server path where the images are saved

Returns Json object

# 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