Forum: Ruby on Rails Using external ruby modules in rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Navjeet N. (Guest)
on 2007-05-06 23:14
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/ (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
Zach I. // LT3media (Guest)
on 2007-05-08 01:01
(Received via mailing list)
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
→ Company — http://www.lt3media.com
→ Portfolio — http://portfolio.zachinglis.com
This topic is locked and can not be replied to.