module Seadragon::SeadragonHelper

Public Instance Methods

seadragon(options = {}) click to toggle source
# File lib/seadragon.rb, line 139
def seadragon(options = {})
  raise ArgumentError.new('a target element must be passed via the id key') unless options[:id]
  raise ArgumentError.new('a tile source must be passed via the tileSources key') unless options[:tileSources]

  options[:prefixUrl] ||= "/assets/openseadragon.github.io/"

  script = javascript_tag("var viewer = OpenSeadragon(#{options.to_json});")
end