I have an application where I would like to issue Ruby commands from a
Rails application and pipe the resulting stuff from the command line
into a Rails variable.
Does anyone have a good way to do this?
Example:
Call to Ruby P.:
ruby callFunction.rb some_params ( where ‘some_params’ is given from a form in the Rails app)
Results Returned:
result - answer1
result - answer2
…
Ideally then I could have these results stored in a variable to put in
my view.
If you want to run your little ruby file there from your Rails app,
stick it
in lib and it will automatically be included if it is a class. If it is
a
module you will have to do include ModuleName to include it.