Showing posts with label plugin. Show all posts
Showing posts with label plugin. Show all posts

Saturday, March 22, 2008

GawingAttachable

Do you want to be able to attach files to something? I needed to do that today and I made a plugin called Gawing Attachable (translated: make_attachable). It allows you to add attachments to something you make attachable.

Yes, there are many things you can still do to this, but like they say: make something quick and fix it up later on.

Check out the README before installing.
script/plugin install http://lucidph.dreamhosters.com/gawing_attachable/trunk

Wednesday, February 27, 2008

Creating your own plugin

I finally forced myself to make my own plugin instead of having controllers and models all over the place. Of course, I waited for the right time to make a plugin that wasn't too different, and needed to be different at the same time.

I chose to make another version of acts_as_voteable by Juixe. Here are the steps I took
  1. I watched Ryan Bates' screencast on making plugins
  2. I coped acts_as_voteable and starting editing things one by one to see what broke.
  3. When I needed a clearer and more advanced explanation (like adding helpers and such), I referred to Geoffrey G's howto on creating plugins.
It took me about 4 hours to figure the whole thing out (I'm a slow learner.. and I already knew about polymorphic associations!).

The change I had to make to acts_as_voteable was that I had to have 3 kinds of votes: positive, neutral and negative. Very small change, right? :)

You can get my plugin like this:

script/plugin install http://lucidph.dreamhosters.com/gawing_voteable/trunk