On Mar 7, 7:25 am, Hemant Bhargava <[email protected]> wrote: > Hemant Bhargava wrote in post #985888: > 5) Creates a model and included the plugin into that model using > require. > require "NAME" > I think this all is OK upto now. But after it when i go to console and > type NAME.hello why does'nt it work.. It should work, right? Or i am > missing something. >
Falling at the last hurdle - if you want to add a module's method to a class you need to use include (require just loads the file containing the module - it doesn't then do anything with that module). You can then do SomeClass.new.hello Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

