I am working on a Rails 3 project where there is place for date input within a form. The text field with the date uses a date picker so there is no concern about the date being
You could override your getters for the :publish_date
attribute.
i.e. in your model:
def date( *format)
self[:publish_date].strftime(format.first || default)
end
and in your view you could do either
@income.date("%d/%m/%Y")
or
@income.date
This would cause strftime to use the passed format string unless it was nil, in which case it would fall back to your default string.
Note: I used the splat operator to add support for getting the date without an argument. There may be a cleaner way to do that.