Plugin to add method to rjs "page" object

Hi,

I would like to add a new method to the rjs “page” object through a
plugin. For a simple example, suppose I want to add the following
which is really just an alias for the usual page.replace_html.

      def replace_html2(id, *options_for_render)
        call 'Element.update', id, render(*options_for_render)
      end

How can I stitch this new method into the “page” object?

Thanks,
Peter

That was easy. Plugins are deceptively simple. Ruby is cool.

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