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.
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...
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…
The Ruby Mine: Ruby Social Club: Roma, 4 Marzo... →
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…
Live pics from @hackitaly
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…
Rails 3: An improved agnostic search model using...
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...
Rails3: using Arel to make conditional searches...
I needed simple searching on some models, and I didn’t want to use any plugin for this task, just because I’d like to try the new rails3 features, like ActiveRelation (Arel). I wrote a basic model called Search, I can re-use it for other models that need search features: Then I wrote a partial form with params, the following code is only an example, I have more fields: Finally the...
Basic user roles management (rails plugin)
I’m working on a very basic Rails plugin to simplify management of user roles. It doesn’t cover authorizations (see @rbates’s cancan), just role names and values (read it as levels). class User < ActiveRecord::Base acts_as_authentic has_roleplay(:admin => 0, :teacher => 1, :student => 2) end With this, you can now check wich roles are avaiable (eg: calling...