Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Documentation request] Please provide a simple standalone .html example (via opal-generated code) to demonstrate how the user clicks on a button, and then a function is called in a ruby class #2423

Open
rubyFeedback opened this issue May 28, 2022 · 2 comments

Comments

@rubyFeedback
Copy link

I finally got opal to work and I compiled some app.js file, which I then used via
a test.html page. It's the hello world example. The dev console shows "Hello
world!" so it works. But now I am not sure how to proceed from here. I looked
at the examples but they seem a bit like unorganized fragments.

Would it be possible to add a NEW example, at:

https://opalrb.com/docs/guides/master/

With SPECIFICALLY this content to be tested:

  • A button in a standalone .html page. (The javascript is compiled into a standalone .js
    that is included in that .html page then)
  • On clicking the button a method is called in a ruby class (but part of that .js file)
    that uses an alert-box to say hello world and fetches some value from a formular
    such as the name of the user. So a button and a form field.

This can be kept as simple as possible. I would like to know how I can work with
data from a form field, and how to use a button to call that.

@hmdne
Copy link
Member

hmdne commented May 28, 2022

There should be a basic howto for opal-browser there I agree. But for now, you can take a look at opal-browser's readme:

https://github.com/opal/opal-browser

@jtoy
Copy link

jtoy commented Aug 19, 2022

Agreed, I had to find this github issue to learn that opal-browser should be used. The docs need way more organization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants