I have a date_field :born_in
for age and i want to display the calculated user age in user profile instead of the regular date format mm/dd/yyyy
I found a method in this answer on how to calculate user's age but i don't know how to implement it in my rails app.
user_information.rb
class UserInformation < ApplicationRecord
belongs_to :user
has_one :gender, :dependent => :destroy
accepts_nested_attributes_for :gender, :allow_destroy => true
has_one :relationship, :dependent => :destroy
accepts_nested_attributes_for :relationship, :allow_destroy => true
end
show.html.erb
<%= @user.user_information.try(:born_in) %>