Forum: Ruby on Rails extending ApplicationHelper not working with plugins

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C618e1d9ffa1bd1a6b6edc8ad4edec63?d=identicon&s=25 mannl (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hi!

I want a plugin to supply me with additonal helpers like this:

#/vendor/plugins/test_plugin/init.rb
module ApplicationHelper
	def test_helper
		'does this work?'
	end
end


Contrary to my expectation, the method "test_helper" is *not*
available in my views..


I thought that maybe the module ApplicationHelper is namespaced
inside some other class, but I can't find anything about that in the
source code.
ApplicationHelperI'm running Rails 0.14.3.


Thanks,
Rob
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 francois.beausoleil (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hello Robert !

2005/11/8, Robert <mannl@gmx.com>:
> I thought that maybe the module ApplicationHelper is namespaced
> inside some other class, but I can't find anything about that in the
> source code.
> ApplicationHelperI'm running Rails 0.14.3.

Take a look at how I do it in the FlashHelperPlugin:
http://rubyurl.com/8LU
http://opensvn.csie.org/traccgi/flash_helper_plugi...

The problem is that the ApplicationHelper module does not exist at the
moment the plugins are loaded.  I too thought ApplicationHelper would
simply be reopened, but it doesn't work that way.

As suggested by Trevor Squires in the RFC Flash Standardization thead
[1], I simply sent the include to ActionView::Base instead.

Hope that helps !
--
François
http://blog.teksol.info/


[1] http://article.gmane.org/gmane.comp.lang.ruby.rails/28302
[1] http://rubyurl.com/gXj
C618e1d9ffa1bd1a6b6edc8ad4edec63?d=identicon&s=25 mannl (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hello Francois!

Thanks for the quick answer. Your solution worked :)

I'm gonna post this in the WIKI now, so that others will be warned



Rob
This topic is locked and can not be replied to.