I'm trying to get oriented with Opal, and I'm a little lost. My use case is that I have a rails backend and vue frontend. I have a module in ruby that computes prices for stuff, and I'd like to have a client-side version of that code without actually duplicating and maintaining two copies. Opal seems like it may be a help here, but I can't figure out how to generate a JS file with some utility methods that can be called by my main (Vue) JS code.
I'm trying to get oriented with Opal, and I'm a little lost. My use case is that I have a rails backend and vue frontend. I have a module in ruby that computes prices for stuff, and I'd like to have a client-side version of that code without actually duplicating and maintaining two copies. Opal seems like it may be a help here, but I can't figure out how to generate a JS file with some utility methods that can be called by my main (Vue) JS code.
Is this a use-case that Opal supports?
The code I'm trying to get working is:
The code I'm compiling to JS:
My command:
...and the error I get: