# 1st Extension - Class Call from module newext\_tags.rb

**URL:** <https://www.ruby-forum.com/t/1st-extension-class-call-from-module-newext-tags-rb/156475>\
**Category:** Radiant CMS\
**Created:** [December 28, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/1st-extension-class-call-from-module-newext-tags-rb/156475 "2008-12-28T17:20:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@bartee](https://www.ruby-forum.com/u/bartee)\
**Post date:** [December 28, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/1st-extension-class-call-from-module-newext-tags-rb/156475/1 "2008-12-28T17:20:50Z")

</div>

I am writing my 1st extension… also new to rails and ruby… oh why  
not…

In the newext\_tags.rb module I am trying to call a method from a  
newext.rb Class Newext

The method cannot be found.

If I move the Class definition at then end of the module NewextTags it  
works.

I am using the rake command:

rake radiant:extensions:newext:update after each update to the code

Also restarting the web server each time.

---

<div class="post-metadata">

**Author:** ![bartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@bartee](https://www.ruby-forum.com/u/bartee)\
**Post date:** [December 29, 2008, 12:23pm UTC](https://www.ruby-forum.com/t/1st-extension-class-call-from-module-newext-tags-rb/156475/2 "2008-12-29T12:23:08Z")

</div>

Hi Bartee (or Lamar?),

Where are the files newext\_tags.rb and newext.rb located?

When you declare methods in newext.rb (which should be located  
somewhere in \lib) you should declare them as class methods (def  
self.my\_method) to be able to call them like this with  
Newext.my\_method.

You don’t need to use the rake update command, it just copies the  
files from your extension’s \public folder to the Radiant  
application’s \public folder, which is not what you want at this  
point. Restarting the web server is necessary, though.

Manuel

---

<div class="post-metadata">

**Author:** ![bartee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/d78d45/32.png) [@bartee](https://www.ruby-forum.com/u/bartee)\
**Post date:** [December 29, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/1st-extension-class-call-from-module-newext-tags-rb/156475/3 "2008-12-29T14:55:03Z")

</div>

Manuel

Excellent!!! That worked.

Thanks… I am obviously new to ruby/rails etc…

My first name is Bartee.

Now on to the next step, I am sure I will have more questions.

…bartee…
