Closed amiel closed 13 years ago
The closest thing that I've seen is http://blog.envylabs.com/tag/jsdom/ -- I'm not a rubyist, so I'm not sure how helpful that is.
maybe you should ask this on the jsdom mailing list
-- Elijah
There is no straight forward answer to this. so im going to close it, however keep this conversation going. You may consider creating a simple nodejs server that plays the roll of a template/content server.
@hij1nx, I agree.. this isn't really a weld issue per se.
Uh yeah, sorry. I didn't mean to imply that this was an issue the weld team needed to work on. I just wanted a place to start this discussion.
Thanks for the pointers. I did see the envylabs article and found that ExecJS.compile_async didn't work at all. (I continually got a JavascriptError on code that worked just fine with ExecJS.compile.
I will also check the jsdom mailing list.
If anyone has anymore thoughts, post 'em here. I'm going to start work on this here: http://github.com/amiel/weld-rails
If you get this working id love to hear about it :) it would make a great blog post!
I'll let you know.
FWIW rendering does work in my "prototype app": https://github.com/amiel/weld-rails-prototype. I think what I'll do if I don't get any specific help from the jsdom mailing list or from therubyracer folks is expect the config hash to be written in javascript and come up with a clever way to include it.
Hello, I figure this might be the best place to start this discussion:
I'm interested in using weld server side within ruby on rails. Has there already been an effort to make this work?
There are a few other javascript based projects running nicely in rails (for example: https://github.com/cowboyd/handlebars.rb). However, this is a little trickier with Weld because it requires a DOM implementation.
Here's what I've tried:
map
andalias
. most of the code is here: https://github.com/amiel/weld-rails-prototype/blob/master/config/initializers/weld_handler.rb Look in app/views/test and app/controllers to see how it is used.)Anyway, I will probably continue working on the execjs implementation, but I was wondering if anyone else was working on this. Also, I think ideally the implementation would use therubyracer instead of execjs and node and therefore would not depend on node and would have the added benefit of being able to write rendering logic in ruby.
Thoughts,
-Amiel