undefined method 'dom_class'

23 Feb 2007

I’ve had a weird situation over here at StudioDanger headquarters with plugins going haywire. I had my app working real slick and then installed the new Engines plugin and the slickness continued unabated. A subsequent installation of the simply_helpful plugin gave me a crazy error:

"undefined method 'dom_class'"

There’s this line in simply_helpful where ActionView::Helpers::FormHelper is monkey-patched to call dom_class and dom_id. These should be available because in the plugin’s init.rb we see the SimplyHelpful helper injected into ActionController as a helper

    require 'simply_helpful'
    ActionController::Base.send :include, SimplyHelpful::RecordIdentificationHelper
    ActionController::Base.helper SimplyHelpful::RecordIdentificationHelper,

At some point ‘self’ became an unmodified version of ActionController while simply_helpful was looking for it’s special helper functions. Why did it to that? I spent three hours trying to figure it out. I have no idea.

You can patch it though. Just change dom_id and dom_class to SimplyHelpful::RecordIdentifier.dom_id and SimplyHelpful::RecordIdentifier.dom_class. That’ll do the trick.

  • Rafael said: http://interblah.net/2007/5/31/a-tale-of-three-modules might be the answer ...

Please if you found this post helpful or have questions.