embedded-ruby

Halting and continuing embebbed ruby code

I call Ruby functions from my C++ code through the embedding commands (rb_eval and the like). Is there any way to stop the execution of the code partway, save the local variables, and restart it from the same spot later? ...

Is there a way of executing embedded ruby in a javascript file in my /public/javascripts directory?

I have a form with an ever-growing amount of associated javascript. At present this javascript lives in my form view which is fine, but it's getting larger and starting to overwhelm the form making it difficult to work on the form. I want to put this in a separate file in my /public/javascripts directory but a lot of the javascript is g...

Embedding Ruby, calling a function from C

Hi, I'm writing an app that calls ruby code from c. I am having a little difficulty and wondered if anyone could point me in the rite direction. I currently have in my C. #include ruby.h main() { ruby_init(); rb_require("myRubyFile"); rb_funcall(rb_module_new(), rb_intern("RubyFunction"), 0, NULL); } My ruby file is in the sam...

Ruby on Rails or programmatically generated <span> or <img>, each on a line, causing spaces in between when displayed

When using Ruby on Rails or other framework, a lot of time we generate <span> or <img> in a loop, and each line will be on a new line. So when it is rendered in HTML, there will be extra space between those inline elements. How can it be solved? Must they be made into 1 long line, or solvable using HTML or CSS? ...

ERB doesnt get executed in javascript scripts

Hi guys I have a select input on my page. this select input displays/hides fields in the form. This all works fine. But the problem is that if i submit the form and lack some necessary fields, it doesnt set the select to the right value afterwards. I just cant get the embedded ruby to work! it keeps escaping the whole thing... here my c...