In my app I want the time/date to display as Month/Year (e.g. 7/10). The problem is sometimes I get class Date and sometimes class Time so I wind up with the following code in the application controller ...
class Date
def as_month_and_year
self.strftime("%m").to_i.to_s + self.strftime("/%y")
end
end
class Time
def as_month_and_year
self.strftime("%m").to_i.to_s + self.strftime("/%y")
end
end
what's the best way to DRY this up?