从ruby中的click事件运行python

Run python from a click event in ruby

我希望能够单击Rails应用程序上的"alert"按钮,然后调用python来运行特定的警报脚本。

我的具体问题是如何让click事件调用python脚本?


(P)检查这篇文章:从鲁比呼叫Pyton脚本(p)(P)Ruby provides a variety of methods,EDOCX1 plography 0,welcx1 plenic EDOCX1 plus 1 communal that all take the path to the EDOCX1 plography 2 palic file along with arguments.Something like(p)字母名称(P)或(p)字母名称(P)甚至回来了(p)字母名称(P)Now,the question is where to put this?I am assuming you have a controller that handles clicks,and it is this controller where you put this code.检查这一链接如何将一个标准的Pyton脚本纳入到一个铁路应用?(p)(P)Now details depended a lot on your python script.By'alert script',do you mean a javascript alert(……)dialog,a flash msg or anything else?It's always a good idea to refactor your pyton code to return a string result and the use that in ruby-on-rails.即使是更好的,作为可能的,写的警告-创造-脚本在鲁比itself!这可能不是一个第三方当事人的图书馆,但一个简单的站立脚本,它是努力!(p)