Why do form_helpers look directly into the database?

> I'm happy to put together a patch if everyone is happy with that soution...?

Another thing to check is if it's feasible to make the form helpers only use _before_type_cast if the field is invalid? Perhaps that'll allow for a relatively low-impact solution?

This would mean that if there is a validation error in some other field, the typecast value gets displayed back to the user. We are using Chronic for date parsing - I don't want the shiny natural language date that the user entered to disappear halfway through the validation process.

Maybe only use before_type_cast if there are _any_ validation errors for the current submission?

I don't think there's anything wrong with the current approach, but I agree that the documentation could be clearer.

--max

Here's another +1 on being able to format the value in a form helper before it's displayed. This shouldn't be in my model since it's purely a display issue. I'd be happy if I could specify another helper method to perform the formatting. Something like:

<%= text_field :product, :price, :formatter => :number_to_currency -%>

-Derrick Spell

Agreed. This would be a useful addition. While we're on the topic, what solution for setters does this naturally work with? We can't just discard the original value that came from the user in case we need to display it again.

-bd