I’m subtracting two dates in my model in this way:-
def total_days
self.to_date - self.from_date
end
My date is in Mysql Date (YYYY-MM-DD)format.
When displaying my date in view it is giving me 5/1 days. Even though 5 is correct it is appending '/1' to the days. How can i remove this. Is there any better way of doing it?
try this, for example
for your solution