Monday, May 19, 2008 8:44 PM
After the last meeting we discussed sharing of plugins and random code that people are messing with so here goes...
Suppose you have a Document attachment_fu model. In less than a minute of setup you can enter as little as the following code into your view and have a fully functional fileman instance...
There are a bunch of other options you can easily set right from the view to support single or polymorphic ownership associations, display icons based on mime type, include link names and captions, show uploaded images (if it’s an image model), hide/show the update and delete links, set custom find options that are automatically scoped, behavior for :has_one relationships, etc.
I am sure that the code could use some heavy refactoring, but it is working in production for me. Currently, it operates as only a generator, though the generated controllers, helper, and fileman views should probably really hook into the application from the plugin...but I have not gotten that far yet.
Anyway, if anyone wants to give it a run it is located on Github. Git it with...
git clone git://github.com/bilson/fileman.git
Also, feel free to ask any questions, refactor, rebuild, demolish, berate, banish, etc.
16095 Prosperity Drive, Suite 600
Noblesville, IN 46060
E-Mail: [address removed]