Keyword "Include"

I am using PGPlot in a ruby script. Ruby has the keywords “require” and
“include” yet Ruby on Rails does not have the “include” keyword. I want
to insert this script in a controller. My ruby script starts:

require 'pgplot' include Pgplot . . .

How do I accomplish the same thing in my RoR controller?

require ‘pgplot’
class SomeController < ApplicationController
include Pgplot


Thanks, works perfect now. I just didn’t see that the require keyword
needed to be outside of the controller class.


The require keyword includes files in your include path (e.g., lib,
your Ruby load path, and so on). The include keyword mixes modules
into classes, so it needs to be inside a class to be used. :slight_smile:


On 1/2/07, Tom [email protected] wrote:

Posted via

My free Ruby e-book:

My blogs: