eRuby (Embedded Ruby) is a templating system that embeds Ruby into a text document. It is often used to embed Ruby code in an HTML document, similar to ASP, JSP and PHP and other server-side scripting languages. Use this tag for questions related to the templating system.
Questions tagged [embedded-ruby]
72 questions
4
votes
3 answers
Embedding Ruby, calling a function from C
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");
…

Lloyd Powell
- 18,270
- 17
- 87
- 123
4
votes
1 answer
Strange behavior with embedded ruby
We are observing a strange behavior on our embedded ruby application. We have stripped down the code to bare minimal and were able to re-produce the issue. Following are the details.
1. The ruby code
#!/usr/bin/env ruby
#require "MyLibrary.so" *//…

sudeep dasan
- 81
- 1
- 6
3
votes
1 answer
How does asynchronous Ruby work in Vim?
If you compile a recent version of Vim with +ruby, you can use the :ruby command inside Vim.
What's happening 'under the hood' when I run some asynchronous Ruby code?
For example:
:ruby <

Chris
- 1,501
- 17
- 32
2
votes
1 answer
Looping Google Maps Markers with embedded ruby?
I'm new to rails and I'm wondering how exactly I could loop these markers. My JS variable "count" is not recognized and I need some help looping through my ruby array or need another solution.
function initMap() {
var mapDiv =…

Howell Lu
- 21
- 1
2
votes
1 answer
Redirect from index.html.erb to a controller method with params
I have a partial _filter.html.erb which uses simple-form. The first line is:
<%= simple_form_for :filter, url: index_panel_path, :method => "get", :html => { :id => "search_by_id"} do |f| %>
So, on click filter button, it calls index_panel_path…

Hellboy
- 1,199
- 2
- 15
- 33
2
votes
2 answers
Cert already in hash table exception
I am using chef dk version 12 and i have done basic setup and uploaded many cookbooks , currently i am using remote_directory in my default.rb
What i have observed is whenever there are too many files /hierarchy in the directory the upload fails…

Rahul
- 170
- 2
- 14
2
votes
0 answers
Html5 - W3C validation errors - Rails(Embedded Ruby)
Kindly guide me to solve these errors in sign up and login views
SIGN UP
<%=…
New to Rails
- 2,824
- 5
- 27
- 43
2
votes
1 answer
Exchanging data between Ruby and C++
I've been looking through tutorials on how to embed Ruby into a C++ program. I've found out how to define a class through "rb_define_class" and "rb_define_class_under" and methods through "rb_define_method". Now i need a good example that explains…

napco
- 63
- 2
- 6
2
votes
1 answer
how to add embedded ruby in style tag
I want to define the width of a status bar dynamically.
First I define the variable:
<% target = (clicks/total_clicks)*100 %>
Then I try to embed the ruby code into a css width tag:

DonMB
- 2,550
- 3
- 28
- 59
1
vote
0 answers
Pass an element index from an erb file to a stimulus controller
hope y'all doing well ! That's a Ruby on Rails and Javascript Stimulus topic :
I'm currently having trouble with a Stimulus controller. I have blog posts (represented by cards) on an index, the cards divs are "generated" from a "each_with_index"…

Henny Pop
- 11
- 1
1
vote
2 answers
Rails - view: Ruby code in link_tag
I'd like to have embededd ruby code as my link name. Right now I tried to implement it like this:
<% @user.each do |user| %>
<%= link_to '<%= user.familyname %>, <%= user.forename %> ', user %>
<% end %>
But it's not working, Rails…

Kirinriki
- 855
- 4
- 12
- 18
1
vote
2 answers
Rails -- ERB is ignoring JS / jQuery
I have the following code below in my view: