Sha256: f686c64766fb31846ea3c885dbb13b1328f0df3a896958bcf13542d1f34284bf

Contents?: true

Size: 809 Bytes

Versions: 8

Compression:

Stored size: 809 Bytes

Contents

# GET request
get '/sample9' do
  haml :sample9
end

# POST request
post '/sample9' do
  # set variables
  set :guid, params[:guid]
  set :width, params[:width]
  set :height, params[:height]

  begin
    # check required variables
    raise "Please enter all required parameters" if settings.guid.empty? or settings.width.empty? or settings.height.empty?

    # construct result string
    v_url = "https://apps.groupdocs.com/document-viewer/embed/#{settings.guid}?frameborder='0' width='#{settings.width}' height='#{settings.height}'"
      
    if v_url
      v_url = v_url
    end

  rescue Exception => e
    err = e.message
  end

  # set variables for template
  haml :sample9, :locals => { :guid => settings.guid, :width => settings.width, :height => settings.height, :v_url=>v_url, :err => err }
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
groupdocs-1.5.0 examples/api-samples/samples/sample9.rb
groupdocs-1.4.2 examples/api-samples/samples/sample9.rb
groupdocs-1.4.1 examples/api-samples/samples/sample9.rb
groupdocs-1.4.0 examples/api-samples/samples/sample9.rb
groupdocs-1.3.0 examples/api-samples/samples/sample9.rb
groupdocs-1.2.11 examples/api-samples/samples/sample9.rb
groupdocs-1.2.10 examples/api-samples/samples/sample9.rb
groupdocs-1.2.9 examples/api-samples/samples/sample9.rb