Read more

Useful Ruby Pathname method

Niklas Hä.
August 13, 2020Software engineer at makandra GmbH

If you have a Ruby Pathname Show archive.org snapshot , you can use the method :/ Show archive.org snapshot to append filepaths to it.

Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

With this method, Ruby code can look like this:

Rails.root/"features"/"fixtures"/"picture.jpg"

Alternatively you can use the #join method, which feels less magic:

Rails.root.join('features', 'fixtures', 'picture.jpg')
Posted by Niklas Hä. to makandra dev (2020-08-13 13:44)