Questions tagged [embedded-ruby]

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.

69 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
  • 16,975
  • 15
  • 80
  • 119
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,269
  • 14
  • 25
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 =…
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…
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,634
  • 4
  • 22
  • 39
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:
However, the html…
DonMB
  • 2,084
  • 3
  • 19
  • 43
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
    • 755
    • 4
    • 9
    • 18
    1
    vote
    2 answers

    Rails -- ERB is ignoring JS / jQuery

    I have the following code below in my view: