clemens/delocalize — pull request #46 by noniq (2012-06-18 18:13:24+00:00)
Title: Additional format options for attributes

This is a fairly large pull request and I’m not sure if you want this kind of feature in delocalize at all :-)

I need custom formatting for some delocalized number attributes, and I’d rather specify those options in the model class instead of adding format options when using `text_field`.

New, extended syntax for `delocalize`:
````ruby
# Delocalize price (using default format) and count (using additional format options)
delocalize :price => :number, :count => {:type => :number, :precision => 0}
````
Additional options, if any, are simply passed through to `number_with_precision` or `I18n.l` (options specified when calling `text_field` take precedence).

The change should be fully backward compatible.