I’ve asked this many times before and have never gotten an answer.
However, form fields will look at the attribute on the model if it’s
not in the database.
Here’s a simplified (non-working) example to modify the formatting of
the created_at field
class YourModel < ActiveRecord::base
self.created_at = date
# apply your special formatting here
Then, in your form, just do
<%= text_field “your_model”, “formatted_date” %>
That’s how I manage to do the special formatting that I need and still
make use of the helpers. I did write a plugin that allowed you to pass
a formatted string into the text_field helper, but I threw it away
because it was too difficult to make it work for select tags,
options_for_select, and others. I found the above approach to be a
If anyone from the core can comment on this, that would be great.
Hope that helps you out.