The FOSDEM was pretty amazing. The Friday night Beer-event was overwhelming to say the least, and on saturday morning there was a very interesting keynote talk on the future of ‘Free and Open’ with many applications moving into the cloud by Mark Surman, of the Mozilla Foundation.
And there were many other good talks, of which for us quite a few were on sunday in the Ruby and Rails developer room.
I arrived there before 10 in the morning, after having had another interesting evening at the Gnome beer event (as for being dwarfish or involved in the Gnome project, I’m quite tall, and only a normal user of the windowmanager). But I had some good chats there, and of course good Belgian beer, especially the Früli strawberry beer.
...anyway, but back to Sunday. A particulary good talk was the one by Peter Vanbroekhoven on the object model of Rails.
We also gave our presentation on sunday, on LogiLogi, the importance of freedom on the Brave New Web, and on the three Rails plugins: Thorny Form, Magick Corners and Body Builder. The sheets can be downloaded here (as pdf, sources here).
Some further good news is that LogiLogi will be presented at the Philosophers Rally 2009 – The Future of Philosophy conference which is held in Enschede on the 12th and 13th of May. This is a conference by and for philosophers, so we are really looking forward to this presentation, and to discussing LogiLogi with them.
The third and last Rails plugin of the plugin triathlon before our presentation tomorrow at the FOSDEM conference is the Body Builder plugin.
This plugin fixes the problem of how to organize the parts of your app that are re-used like blocks across pages, like those in side-bars and top-bars. It allows you to create render-points where content can be inserted in views. In short it allows one to set body_parts (variables that can be yielded in views) from controllers. Also since Rails components are notoriously slow, this is a nice alternative.
After installing the plugin you can declare body parts in your controllers (most often only in controllers/application.rb) with: body_parts :top, :sidebar. Then you can fill them up in the same, or in inheriting controllers by passing method syms to body- name_body, just like Rails filters: top_body :navigation_bar. The return value of these methods will be added to the body.
Then in the view you can display the body with <= yield :sidebar_body %> resp. <= yield :top_body %>. As you can see Body Builder supports multiple, user-defined bodies. This contrary to the SimpleSidebar plugin. See the full Body Builder docs for code examples and installation instructions.
Our second Rails Plugin to be released is Magick Corners. It is for adding Scalable Vector Graphics as backgrounds to dom- elements without a hassle. It can scale and stretch them to size, and also generate them for simple cases like a div with rounded corners.
After installing the plugin you can apply rounded corners to any dom-object (only divs are officially supported) using css-selectors, like: mcorners = new MagickCorners(); mcorners. add(‘div.logi_body’). And also display any SVG image as the background of divs of any size with: mcorners.add(‘div.add_tag’, {‘scaled_image’ : ‘add_tag.svg’}). Images are scaled/folded to suit. See the full Magick Corners docs for a code example and detailed installation instructions.
Over three days we will be releasing Rails Plugins extracted from LogiLogi.org in a little Plugin Triathlon. And then on Sunday, the fourth day, we will present the three of them (at least two, three if time permits) in the Ruby and Rails room of the FOSDEM in Brussels. And the first one is released today. It is Thorny Form
Thorny Form is a Rails plugin for unobtrusively protecting forms against form-SPAM. It adds extra fields like a honeypot and some others which can then be checked before the form-data is used in your application. It is not an unbreakable solution, but it is likely to continue to work for quite some time. The following joke from Ned Batchelders blog nicely sketches why:
Jim and Joe are out hiking in the forest, when in the distance, they see a huge bear. The bear notices them, and begins angrily running toward them. Jim calmly checks the knots of his shoes and stretches his legs.
Joe asks incredulously, “What are you doing? Do you think you can outrun that bear!?”
Jim replies, “I don’t have to outrun the bear, I just have to outrun you.”
To use Thorny Form you just need to change two lines per form. First in the view form_for has to be replaced by thorny_form_for (remote_form_for by remote_thorny_form_for). Then in the controller you have to add a check for spam in the shape of self.thorny_form_free_of_spam?. See the full Thorny Form docs for a code example and installation instructions.



News feed