I have my show page UserPrice :purchase_date attribute that is a date_select and I want to change its view:
<%= @user_price.purchase_date %>
from this (default):
Purchase Date: 2011-10-28
to these different formats:
- October 28, 2011
- 10/28/2011
How is this done?
Thank you.
Ignoring the fact that you might want put this in a helper (or these days, a decorator/presenter)… you could do the following directly in your view:
October 28, 2011
10/28/2011