I am still learning Ruby on Rails, but have a general question about using a link on a Rails view to trigger a ruby program to run. In other words, rather than type “ruby filename.rb” at the command prompt, I want a link in my Rails view to execute the code in filename.rb, when it’s clicked.
I know this is a bit of hack, but I’m trying to learn one step at a time…
If you’re using Ruby 1.9.x you can use Process.spawn;