4

Is there a way to call a jruby function from javascript, let's say that I need my user interface to be on the browser side.

Note: I'm not using Ruby on Rails

~ Eder Quiñones

5
  • 1
    Do you mean browser-hosted Ruby? Or calling Ruby on the server from JavaScript on the browser? (Since you mention a browser.) Or calling compiled JRuby in an applet on the browser? You see how the question is a tad non-specific. :-) Commented Aug 11, 2011 at 17:48
  • No, ruby is not hosted on the server. Commented Aug 11, 2011 at 17:50
  • Is it possible to write an applet using JRuby? Because that would perfectly match my needs! Commented Aug 11, 2011 at 17:55
  • 1
    @Eder, stackoverflow.com/questions/5423888/… Commented Aug 11, 2011 at 17:58
  • Are you under the assumption that the "java" in "javascript" means you can use JRuby? Commented Aug 11, 2011 at 23:48

2 Answers 2

2

Short answer

No.

Long answer

You can create some server side application and call it through AJAX.

UPD

And yes: How do you create a Java applet using JRuby? :D

Sign up to request clarification or add additional context in comments.

Comments

2

Not directly. But you can use AJAX to send a request to ruby code on the back-end. That code can then send data to the front-end in the AJAX response (for example, as JSON).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.