9 lines
273 B
Ruby
9 lines
273 B
Ruby
class HomeController < ApplicationController
|
|
def years_between_dates(date_from, date_to)
|
|
return (date_to - date_from).to_i / 365
|
|
end
|
|
|
|
def index
|
|
@age = years_between_dates(DateTime.civil_from_format(:local, 2005, 6, 7), DateTime.now)
|
|
end
|
|
end
|