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: <code> require 'pgplot' include Pgplot . . . </code> How do I accomplish the same thing in my RoR controller?
on 2007-01-02 19:31
on 2007-01-02 19:43
require 'pgplot' class SomeController < ApplicationController include Pgplot end
on 2007-01-02 20:20
Eric, Thanks, works perfect now. I just didn't see that the require keyword needed to be outside of the controller class. Cheers TB
on 2007-01-02 20:51
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. :) --Jeremy On 1/2/07, Tom <firstname.lastname@example.org> wrote: > Posted via http://www.ruby-forum.com/. > > > > -- My free Ruby e-book: http://www.humblelittlerubybook.com/book/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/