Hi everyone! Is it possible to call a ruby method inside javascript? One way of implementing it is via ajax calls, but is there a way I can embed that ruby function inside the js file and call it just like calling any other js function?
+1
A:
Assuming you want the JavaScript to run in a web browser: No. Browsers don't have Ruby engines built in.
David Dorward
2010-05-05 05:31:23
+1
A:
No. Not without using Silverlight Dynamic Languages (or similar plugin) to act as a vessel for the language.
Even then, it's not embedding into JS, it's just adding another possible language to the <script>
tag.
Matt
2010-05-05 05:31:37
+1
A:
I think you want something like RubyJS. This is a port of Google Web Toolkit to Ruby. Essentially it will let you write Ruby code that is compiled into JavaScript then run in the browser.
Matthew Flaschen
2010-05-05 06:00:53
A:
For Rubyt there was http://hotruby.yukoba.jp/ but it seems like the project stalled.
Julik
2010-05-05 13:41:25