# Call Ruby file from HTML

**URL:** <https://www.ruby-forum.com/t/call-ruby-file-from-html/176827>\
**Category:** Ruby\
**Created:** [October 6, 2009, 7:06pm UTC](https://www.ruby-forum.com/t/call-ruby-file-from-html/176827 "2009-10-06T19:06:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yousef\_1987](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/51bf81/32.png) [@yousef\_1987](https://www.ruby-forum.com/u/yousef_1987)\
**Post date:** [October 6, 2009, 7:06pm UTC](https://www.ruby-forum.com/t/call-ruby-file-from-html/176827/1 "2009-10-06T19:06:15Z")

</div>

hi everybody

is there a possible to call Ruby file from HTML file , and how I can do  
that.

thanks in Advance

---

<div class="post-metadata">

**Author:** ![yousef\_1987](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/51bf81/32.png) [@yousef\_1987](https://www.ruby-forum.com/u/yousef_1987)\
**Post date:** [October 7, 2009, 12:39am UTC](https://www.ruby-forum.com/t/call-ruby-file-from-html/176827/2 "2009-10-07T00:39:08Z")

</div>

What do you mean? Embedding ruby code in HTML like Javascript? That is  
not possible. Or do you mean something else?

---

<div class="post-metadata">

**Author:** ![yousef\_1987](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/51bf81/32.png) [@yousef\_1987](https://www.ruby-forum.com/u/yousef_1987)\
**Post date:** [October 7, 2009, 8:00am UTC](https://www.ruby-forum.com/t/call-ruby-file-from-html/176827/3 "2009-10-07T08:00:00Z")

</div>

Yousef J. wrote:

> hi everybody
> 
> is there a possible to call Ruby file from HTML file , and how I can do  
> that.
> 
> thanks in Advance

Situations:

1. html file + ruby file on the server, and you want the request for the  
html file to trigger the execution of the ruby file

2. The html file is displayed in the client browser, and you want some  
action by the user to trigger the execution of a ruby file on the server

3. The html file is displayed in the client browser, and you want some  
action by the user to trigger the execution of a ruby file located on  
the client’s computer.

You can do 1) with ruby, you can do 2) with javascript, but I don’t  
think you can do 3) with anything.

---

<div class="post-metadata">

**Author:** ![yousef\_1987](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/51bf81/32.png) [@yousef\_1987](https://www.ruby-forum.com/u/yousef_1987)\
**Post date:** [October 7, 2009, 9:24am UTC](https://www.ruby-forum.com/t/call-ruby-file-from-html/176827/4 "2009-10-07T09:24:45Z")

</div>

Eruby is a handy way of mixing html and Ruby. It’s like PHP.
