[Radiant] ActionView helpers in a behavior - I think I got it!
Jay Levitt
lists-radiant at shopwatch.org
Mon Jul 17 18:37:52 CDT 2006
Here's the relevant parts of a navigation-tab plugin I'm in the process
of hacking together... and I have just successfully called image_path
from it. Hope this helps someone.
class Behavior::Base
define_tags do
tag "navtab" do |tag|
tab = NavTab.new(tag.attr['label'], @request)
# ...
end
end
end
class NavTab
include ActionView::Helpers::AssetTagHelper
def initialize (label, request)
@label = label
@controller = ActionController::Base.new
@controller.request = request
p image_path('hi')
end
# ...
end
More information about the Radiant
mailing list