[uf-rest] New microformat/REST Ruby Parser: mofo

Chris Wanstrath chris at ozmm.org
Wed Mar 21 21:56:47 PST 2007


On 3/19/07, Ryan King <ryan at technorati.com> wrote:

> Of course, if you were to make, for example, your Person model use
> the same field names as hCard/vCard you could skip the step of
> figuring out how to represent a person (again).

Yep.  You could also use alias_attribute if the model fields and the
microformat fields don't match up and you don't need any special
processing to coerce the uf data.

For example, if you have an hCard and you're using the 'bday'
attribute but your model has a 'date_of_birth' field:

alias_attribute :bday, :date_of_birth

Now you can @person.bday = Time.now (or something) and it'll be
functionally the same as @person.date_of_birthday = Time.now.

However, I gotta say: posting HTML is kind of awkward.  Isn't it?
Microformats are for publishing and talk of posting them to endpoints
kinda gives me the willies...

-- 
Chris Wanstrath
http://errtheblog.com


More information about the microformats-rest mailing list