Hide file which is showing despite of gitignore
July 29, 2016
Paste image into prawn pdf with StringIO and base-64 encoding
March 3, 2016
I getting BASE64_IMAGE_GOES_HERE from signature_pad js lib with getSignatureImage() method.
Multi-column PDF generating with Prawn in ruby
January 29, 2016
For example, you need to generate a content (or table) with width 20-30% of page and it should not break the page if height is too big but should continue on the same page in the right side.
It will look like that:
Prawn has very useful methodfor doing that called 'column_box'.
Ruby on Rails convert array into Relation object
December 21, 2015
Language plural rules (includes I18n)
August 10, 2015
Table with plural rules:
Rails 4.1 html and tags chars sanitize
May 18, 2015
To remove all tags and chars like 'nbsp;' in rails 4.1 do that:
Rails timezones difference
April 9, 2015
- In Rails, Time.zone refers to the Rails (not system) timezone, set by config.time_zone (typically in application.rb)
- DateTime and Time are not otherwise Rails aware, therefore, DateTime.now and Time.now both return times in the system timezone.
1.month.agoand similar methods use the Rails timezone, but DateTime.now.last_month uses the system timezone
- When retrieving things from ActiveRecord, they will be timezoned to the Rails timezone, so Product.first.created_at will give you a time in the Rails timezone (not the system timezone)
So, don't mix Rails timezone methods like “1.month.ago” with system timezone methods like “DateTime.now.last_month”