ActiveSupport · Rails

Defining customized Date / Time format in Rails

Generally to display customized Date / Time in rails we use helper method like: # formats the date def show_date(date)   date.strftime("%B %d, %Y") end But there is another better way to do this, injecting customized rules in respective DATE_FORMATS hash of ActiveSupport::CoreExtensions module. # define this in your environment.rb # Default date/time format ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:standard… Continue reading Defining customized Date / Time format in Rails

love · maths

Maths: New language of love

When it comes to love people find numerous ways to express it, but can maths helps ?  surely it can ! Check out Suss ! What's suss ? it's an alzebric surface represented by equation: (x2+9/4y2+z2-1)3 - x2z3-9/80y2z3=0 and what it represents ? Heart ! Don't believe me, check out this page: simply amazing… Continue reading Maths: New language of love