<?xml version="1.0" encoding="UTF-8"?>
<page>
  <body>ActsAsMonkey is a sample Rails plugin. I created it because I see many asking for information/documentation on how to write a Rails plugin, and the best way to learn how to do something is to see how it's done, is it not? :)

So, why monkeys? Well, because when you write a plugin for Rails, if you're not monkey _patching_, you're definitely monkeying around with Rails internals. And that's why there is so little documentation on the subject too, because there's nothing to document. No classes, no API. Just files with arbitrary code in them. It's a bit more orderly than that, but even so, in order to write a Rails plugin, *you need to have an intimate knowledge of Ruby and Rails*. You need to know how classes, modules and methods work in Ruby and which parts of Rails do the things you want to mess around with.

You can get the plugin from my repository here:

&quot;http://nimrod.interinter.net/plugins/trunk/acts_as_monkey&quot;:http://nimrod.interinter.net/plugins/trunk/acts_as_monkey

h3. Other resources on writing plugins

Geoffrey Grosenbach goes through the whole process of creating a plugin in _The Complete Guide to Rails Plugins_ &quot;part 1&quot;:http://nubyonrails.com/articles/the-complete-guide-to-rails-plugins-part-i and &quot;2&quot;:http://nubyonrails.com/articles/the-complete-guide-to-rails-plugins-part-ii.</body>
  <created-at type="datetime">2007-06-21T00:34:34-04:00</created-at>
  <id type="integer">15</id>
  <parent-id type="integer" nil="true"></parent-id>
  <published type="boolean">true</published>
  <slug>sample_rails_plugin</slug>
  <summary></summary>
  <title>Sample Rails Plugin</title>
  <updated-at type="datetime">2008-03-15T17:02:31-04:00</updated-at>
</page>
