Hello,

I'm facing this problem while trying to extend the parse_redmine_links
helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin.

My idea is to use alias_method_chain so the extended version could
call the original version and adjust the result to it's liking.

Anything I've tried so far exposes this behavior: the first render of
a page uses the extended version, while every later renders use the
original unmodified helper.

I've tried to include my patch module in the plugin's init.rb like
this:

require_dependency 'application_helper'
ApplicationHelper.send(:include,
RedminePastebin::ApplicationHelperPatch)

Also I've tried to define my ApplicationHelper in myplugin/app/helper/
application_helper.rb with the same effect.  Both approaches used
self.included hook to call alias_method_chain, like this:

  def self.included(base)
    base.module_eval do
      alias_method_chain :parse_redmine_links, :pastes
    end
  end

Any ideas on how to accomplish the task are welcome!
--
Alex

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to