i have a ruby script in a folder outside of my sinatra application I would like to run from my sinatra application at the click of a button
get '/' do
get '/launch_script' do
<a href='/launch_script'> Launch a Script </a>
You can use
require_relative (depending if your file is located in a static place or relative to this file). Adding .rb is not required at the end either.
require 'sinatra' get '/' do erb :home end get '/launch_script' do require 'path\\to\\file\\delete_rows_csv' end