# Call rb file on HTML

**URL:** <https://www.ruby-forum.com/t/call-rb-file-on-html/175355>\
**Category:** Rails\
**Created:** [September 11, 2009, 7:34pm UTC](https://www.ruby-forum.com/t/call-rb-file-on-html/175355 "2009-09-11T19:34:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@marlon](https://www.ruby-forum.com/u/marlon)\
**Post date:** [September 11, 2009, 7:34pm UTC](https://www.ruby-forum.com/t/call-rb-file-on-html/175355/1 "2009-09-11T19:34:38Z")

</div>

Hi

I’m a beginner in ruby and I just to know how to call rb file on HTML.  
For example I have an .rb file that contains a class and some  
functions. How can I call that on an HTML for example there’s a link  
or button on the HTML or just run the rb file. helpful links/tutorials  
are also appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![marlon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@marlon](https://www.ruby-forum.com/u/marlon)\
**Post date:** [September 11, 2009, 7:36pm UTC](https://www.ruby-forum.com/t/call-rb-file-on-html/175355/2 "2009-09-11T19:36:24Z")

</div>

On Sep 11, 12:41 pm, Marlon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi
> 
> I’m a beginner in ruby and I just to know how to call rb file on HTML.  
> For example I have an .rb file that contains a class and some  
> functions. How can I call that on an HTML for example there’s a link  
> or button on the HTML or just run the rb file. helpful links/tutorials  
> are also appreciated.

I don’t understand the question. Do you want to have a button on a web  
page that runs some code of your choosing ? If so you should link /  
post a form to an action in one of your controllers that runs your  
code.

Fred

---

<div class="post-metadata">

**Author:** ![marlon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@marlon](https://www.ruby-forum.com/u/marlon)\
**Post date:** [September 11, 2009, 8:05pm UTC](https://www.ruby-forum.com/t/call-rb-file-on-html/175355/3 "2009-09-11T20:05:40Z")

</div>

2009/9/11 Marlon [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hi
> 
> I’m a beginner in ruby and I just to know how to call rb file on HTML.  
> For example I have an .rb file that contains a class and some  
> functions. How can I call that on an HTML for example there’s a link  
> or button on the HTML or just run the rb file. helpful links/tutorials  
> are also appreciated.

The rails guides at [http://guides.rubyonrails.org/](http://guides.rubyonrails.org/) are great, start  
with ‘getting started’ obviously, having worked through there you see  
that your question does not make sense. Move on to ActiveRecord  
associations and the others. The railscasts are also very useful.

Colin

---

<div class="post-metadata">

**Author:** ![marlon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@marlon](https://www.ruby-forum.com/u/marlon)\
**Post date:** [September 12, 2009, 2:20am UTC](https://www.ruby-forum.com/t/call-rb-file-on-html/175355/4 "2009-09-12T02:20:51Z")

</div>

Thanks for your help…
