I was asked to contribute to a simple web app built using Smashing (a Sinatra-based framework). I have a little experience with rails, but I am not familiar with this framework (or Sinatra) nor I am sure why it was chosen. I understand it is useful to build dashboards and believe it was chosen because this kind of front-end meets the client's requirements. So far I even struggle to understand where the controller is.
What I have been failing to do all day is something that at least sounds very easy: run a bash script on the server side when a button on the web page is clicked and display a message like "job done" (or "error" if something goes wrong).
So I have a typical button like:
<button id='script_btn' type='button' class='btn btn-danger'>run script</button>
And somewhere in my project folder a file script.sh.
How do I make the button click execute "script.sh" and return a message that the script run successfully (or that errors occurred)?
I keep searching but I seem to find info about this mostly for PHP, Node.js, and maybe something for rails but nothing really in my case. Any help would be much appreciated.
(There is no tag smashing so I'll use dashing instead it seems to be its predecessor)