PLUGIN newbie: How do I use an installed plugin

All,

I’ve downloaded and installed a plugin into my vendor directory. How do
I then take advantage of it?

It has an init.rb file which has the appropriate require.

What do I need to do to make sure that the plugin code gets loaded?

Thanks,
Wes

If the plugin is placed in your vendor/plugins directory, it will be
loaded automatically, i.e. the plugin should be in
vendor/plugins/, with the init.rb file at
vendor/plugins//init.rb.

james

On 7/5/06, Wes G. [email protected] wrote:

All,

I’ve downloaded and installed a plugin into my vendor directory. How do
I then take advantage of it?

It has an init.rb file which has the appropriate require.

What do I need to do to make sure that the plugin code gets loaded?

As long as the plugin is in vendor/plugins then its init.rb will
automatically be called when your application is loaded, there are no
additional steps needed.

Josh

James A. wrote:

If the plugin is placed in your vendor/plugins directory, it will be
loaded automatically, i.e. the plugin should be in
vendor/plugins/, with the init.rb file at
vendor/plugins//init.rb.

james

I am trying to use the “fix_date” plugin.

The plugin is in my vendor/plugins directory.

The init.rb file is in vendor/plugins/fix_date/init.rb.

Here are the contents of init.rb:

Include hook code here

require ‘fix_date’

There is a fix_date.rb file in vendor/plugins/lib.

However, I am unable to access the new functionality provided by the
plugin (incidentally, this plugin modifies
ActionView::Helpers::DateHelper to change the select_date and
select_hour methods).

How, exactly, is it “loaded automatically”? I’ve restarted my app.
twice and I see no change in the select_hour method.

All of the examples I can find seem to have to do with plugins that need
to be “called” by file name in an ActiveRecord descendant.

Is there something else that I need to do in order to access the plugin
methods?

Thanks,
Wes

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs