I’m using a slight modification of the simple_date_select plugin to
display and accept input for dates in m/d/yyyy format. But this doesn’t
handle the view of dates when they are not being edited.
Being new to Ruby and Rails I couldn’t figure out how to create a
similar simple_date_view plugin. And it seems too much to ask that
someone else create one! So the next best thing is to at least create a
function that my models can call for each date field. I tried putting
this function in controllers/application.rb but nothing seems to happen,
not even an error message. So I suspect that functions in that location
are not available to models. So where would I put my little
date-conversion function?
By the way, I can get the code to work if it’s in the model itself, but
I want to have a global function so I don’t have to repeat the code for
each field.
Thanks,
Shauna