1st Extension - Class Call from module newext_tags.rb

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.

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

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…