Help getting plugin to work

Hi,

I want to create a plugin that allows easy use of the Yahoo! UI
library similar to the prototype.js and scriptaculous helpers that
come packaged with rails.

just one line in plugins/yui/init.rb

require ‘yui_helper’

a little more in plugins/yui/lib/yui_helper.rb

module ActionView
module Helpers
module YuiHelper
def yui_form_remote_tag(options = {})
options[:html] ||= {}
options[:html][:action] = options[:html][:action] ||
url_for(options[:url])
options[:html][:onsubmit] =
“Yui.post_form(’#{options[:html][:action]}’,this);return
false;”
options[:html][:method] = options[:html][:method] || ‘post’

    tag('form', options[:html], true)
  end
end

end
end

When I use

<%= yui_form_remote_tag(:url=>{:action=>‘update’, :id=>@category}) %>
in a view I see

undefined method `yui_form_remote_tag’ for
#<#Class:0x2546c20:0x2546bf8>

I know the method works when it is in my application_helper.rb file
but what do I have to say in yui_helper.rb to make the method visible
from within the plugin?

Thanks,
Peter

On 7/3/06, Peter M. [email protected] wrote:

Hi,

I want to create a plugin that allows easy use of the Yahoo! UI
library similar to the prototype.js and scriptaculous helpers that
come packaged with rails.

Hi,

I found this article which made it all clear

http://nubyonrails.com/articles/2006/05/09/the-complete-guide-to-rails-plugins-part-ii

resolved.

Thanks,
Peter

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