# Using external ruby modules in rails

**URL:** <https://www.ruby-forum.com/t/using-external-ruby-modules-in-rails/103482>\
**Category:** Rails\
**Created:** [May 6, 2007, 9:14pm UTC](https://www.ruby-forum.com/t/using-external-ruby-modules-in-rails/103482 "2007-05-06T21:14:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsingh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8491ac/32.png) [@nsingh](https://www.ruby-forum.com/u/nsingh)\
**Post date:** [May 6, 2007, 9:14pm UTC](https://www.ruby-forum.com/t/using-external-ruby-modules-in-rails/103482/1 "2007-05-06T21:14:58Z")

</div>

Hello there,

I am fairly new to rails and i was trying to accomplish the following:  
There is a gem called ‘scrubyt’ [http://scrubyt.org/](http://scrubyt.org/) (for web scraping)  
and i want to use it in my rails application.

I just don’t know what is the best way to use it. Should I make a model  
that extends from the module? Or can I somehow use the module directly  
in Rails controller.

I guess my problem is that I am not too familiar with ruby modules and  
how to extend them in rails.

any help will be highly appreciated!  
nsingh

---

<div class="post-metadata">

**Author:** ![nsingh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/8491ac/32.png) [@nsingh](https://www.ruby-forum.com/u/nsingh)\
**Post date:** [May 7, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/using-external-ruby-modules-in-rails/103482/2 "2007-05-07T23:01:07Z")

</div>

To extend a module in Rails, you purely just call it again.

Lets say you have “module MyModule”, then just write “module MyModel”  
in the file which you extend from.

If it’s an already built class and you want to override module  
MyModule; class SubClassâ€¦ Make sure you include the SubClass or it  
won’t be overridden.

There should be decent documentation on how to do it on the gem’s  
website or atleast elsewhere. Check that out.

Zach I.  
â†’ Blog â€” [http://www.zachinglis.com](http://www.zachinglis.com)  
â†’ Company â€” [http://www.lt3media.com](http://www.lt3media.com)  
â†’ Portfolio â€” [http://portfolio.zachinglis.com](http://portfolio.zachinglis.com)
