1. Moving this blog to my home

    Hi there!

    Just for the record, my new blog/website is http://andreapavoni.com. I’ve also moved some technical posts there.

    cheers,

    A.

  2. Billy listens to Vivaldi music

    Billy listens to Vivaldi music

  3. Store Rails views on database

    When it comes to develop a CMS, one of the main problems concerns where or how to store and organize views (templates, partials, layouts) for particular needs like different layouts for specific pages, (sub)domains or multi-languages. The ideal way is to store views on a database, indeed there are some CMSs that solve this problem with similar approaches, like Radiant and Locomotive.

    However, I wanted something that let me to reuse this feature on several projects (because a custom CMS may have different features), and to store only certain views, according to specific content and needs.

    So, I’ve developed Panoramic, a simple gem inspired from some ideas found in José Valim’s excellent book Crafting Rails Applications. Simply put, once Panoramic is installed, you can store your views on database. It works through an implemetation of ActionView::Resolver class: Rails will lookup views as if they were on filesystem. In controller, you’ll tell where and when to use those views, using prepend_view_path and append_view_path on a controller or action basis (they are both implemented as class and instance methods). Depending from the method you’ll use, Rails will respectively look for views on database, then it will fallback on filesystem, or viceversa. Quite easy, right?

    I’ll not show any code here, because there’s a full explanation on Panoramic’s README. As a final note, at the moment it works only with ActiveRecord, but I’ve planned to extend support to DataMapper and Mongoid as soon as possible. It’s very easy to implement, the main problem is about testing: maybe I’ll write some rspec’s custom matchers to reuse with different ORMs, like carrierwave.

  4. hackitaly:

    Il nuovo video di Hackitaly. Stay Tuned per il prossimo evento

  5. hackitaly:

Con tutto il rispetto al buon Saviano che ci ha fatto piangere e sognare con i suoi libri e le sue trasmissioni televisive , noi di Hackitaly pensiamo che l’Italia debba ricominciare da persone come ANTONIO TRAPANI , hacker e developer di Hackitaly .
E da tutti gli startupper e developers italiani .
E non da qui http://mag.wired.it/rivista/storie/la-rivoluzione-secondo-roberto-saviano.html
ANTONIO, grazie di esistere, e grazie per quello che stai facendo per l’Italia, probabilmente la copertina di Wired non avrai mai pensato di averla.
Ma noi te l’abbiamo data e secondo noi questa è la più bella di tutte.

    hackitaly:

    Con tutto il rispetto al buon Saviano che ci ha fatto piangere e sognare con i suoi libri e le sue trasmissioni televisive , noi di Hackitaly pensiamo che l’Italia debba ricominciare da persone come ANTONIO TRAPANI , hacker e developer di Hackitaly .

    E da tutti gli startupper e developers italiani .

    E non da qui http://mag.wired.it/rivista/storie/la-rivoluzione-secondo-roberto-saviano.html

    ANTONIO, grazie di esistere, e grazie per quello che stai facendo per l’Italia, probabilmente la copertina di Wired non avrai mai pensato di averla.

    Ma noi te l’abbiamo data e secondo noi questa è la più bella di tutte.

  6. The Ruby Mine: Ecco i talk del #rsc Milano →

    therubymine:

    Bene ragazzi,

    le 3 presentazioni di giovedì sera sono ormai definite, ma per chi volesse possiamo aggiungerne una quarta, se mai qualcuno avesse qualche nuova cosa da far vedere.

    Giordano Scalzo. Ci parlerà di mongo mapper, un wrapper ruby che ci permette di usareMongoDB, cercando di…

  7. The Ruby Mine: Ruby Social Club: Roma, 4 Marzo 2011 →

    therubymine:

    La comunità italiana di Ruby è attiva come non mai!

    Dopo aver iniziato un progetto di beneficenza (Hack for School) e gettato le basi per la prima Ruby conference nazionale, siamo lieti di annunciare il ritorno dei Ruby Social Club.

    In occasione del primo Codemotion ci ritroveremo tutti…

  8. Live pics from @hackitaly

    hackitaly:

  9. Coderloop's blog: Riding Rails 3 →

    yeah, it was funny!

    coderloop:

    126 commits later and after 2091 files changed, Coderloop infrastructure is eventually running on Rails 3. The full story of this migration deserves a blog post on its own and we will describe some opensource code that we have released. We are very proud of this big achievement and happy about…

  10. Rails 3: An improved agnostic search model using Arel

    In the last post, I explained how to make conditional searches based on conditional params. I wrote a very simple search model that returns a real model with query done by Arel. I refactored the code to make i simpler to use:

    The constructor takes the model you want to search in, and an hash of params to use, they’ll be the request params when used from controller. Note that if some param value is an empty string, it will be ignored: this lets the visitor to leave blank some fields in the search form and make it conditional.

    To save typings, when specifying conditions, you can omit the value, because it’s taken from the params hash. By the way, if you need some more control, you can specify another value. Finally, you can pass a block to make it easier to read. Here’s a real usage example from a controller:

    When Search#result is called a model instance is returned, it can still be ordered.

    According to Arel README, there’s no support for OR conditions yet, I hope it will be included soon.

    What do you think about?