GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
As far as I can tell envjs, Johnson (and hence Harmony) dont' yet support AJAX calls, so this won't work exactly as planned. However I should be able to hack around this if I can do something like this:
@harmony = harmony_page
# use mechanize etc to get and parse
# somehow I'd need to set this.responseText with the response etc.
@harmony.execute_js(args['onSuccess']) if it_works and args['onSuccess']
@harmony.execute_js(args['onFailure']) if !itworks and args['onFailure']
tl;dr: Is there a simple way for me to provide Ruby methods that can be called from the JS environment (specifically, overriding the ones in the JS environment)
Thanks in advance!
I got carried away and made something that works, how well it works I have no idea!
I'd appreciate your input! http://gist.github.com/558802