# GET request get '/sample16' do haml :sample16 end # POST request post '/sample16' do # set variables set :fileId, params[:fileId] begin # check required variables raise "Please enter all required parameters" if settings.fileId.empty? # construct result iframe iframe = "" rescue Exception => e err = e.message end # set variables for template haml :sample16, :locals => { :fileId => settings.fileId, :iframe => iframe, :err => err } end