One Ruby Thing

An email newsletter, with one Ruby/Rails technique delivered with a 'why?' and a 'how?' every two weeks. It's deliberately brief, focussed & opinionated.

Ruby/Rails techniques, every two weeks

  1. Handle Uncountable Words in Rails Inflections Mar 23rd, 2026
  2. Declare Acronyms in Rails Inflections Mar 16th, 2026
  3. Group Repeated Options with with_options Mar 9th, 2026
  4. Customize Model URLs with to_param Mar 2nd, 2026
  5. Use StringInquirer for Readable Predicate Methods Feb 10th, 2026
  6. Prefer in? Over include? for Readable Conditions Feb 2nd, 2026
  7. Simple Tailwind CSS 4 Setup for Jekyll Jan 27th, 2026
  8. Find the Last Matching Element with rfind Jan 12th, 2026
  9. Skip Validations in Specific Contexts with except_on Sep 7th, 2025
  10. Rails World 2025 Sep 7th, 2025
  11. Further Performance Testing Enumerable’s Loveliness May 29th, 2025
  12. Performance Testing Enumerable’s Loveliness May 26th, 2025
  13. Enumerable’s loveliness May 26th, 2025
  14. What’s the difference between Rails’s try and the safe navigation (&.) operator? Apr 28th, 2025
  15. Using Deep Duplication to Avoid Surprises Mar 13th, 2025
  16. Ordinal Numbers in Rails: 1st, 2nd, 3rd, 4th Feb 5th, 2025
  17. Use blank? and present? in Rails Nov 11th, 2024
  18. Launching UsingRails: A Directory of Rails-Based Organisations Oct 16th, 2024
  19. Compress Your Images Jun 5th, 2024
  20. Railsconf Detroit 2024: A Co-chair’s Perspective May 19th, 2024
  21. Validate Email Addresses Feb 26th, 2024
  22. Read the .ruby-version into your Gemfile Feb 7th, 2024
  23. Why go to a Ruby or Rails conference? Feb 2nd, 2024
  24. Find definitions of Rails methods using source_location and bundle open Dec 4th, 2023
  25. For clarity merging hashes use with_defaults Nov 20th, 2023
  26. Customize and abbreviate number_to_human Oct 16th, 2023
  27. Express yourself clearly with positive? and negative? for numbers Sep 11th, 2023
  28. Play in a sandbox in production Aug 14th, 2023
  29. Beware of <%== in your erb files Jul 17th, 2023
  30. Really, Really, Really Don’t Interpolate Strings into Active Record Methods May 29th, 2023
  31. Assign a default value to an attribute in Active Record Mar 13th, 2023
  32. Consider find_each for looping through Active Record associations Feb 27th, 2023
  33. Try not to loop through associations inside jobs Feb 13th, 2023
  34. Only use locals in view partials Jan 22nd, 2023
  35. Find out what callbacks are defined on an Active Record model in the console Dec 5th, 2022
  36. Safely Remove a Column from an Active Record Model Nov 14th, 2022
  37. Use zero? for comparison of numerics like Integer, Float and BigDecimal Oct 31st, 2022
  38. Time Ranges are Clearer When Querying Databases Oct 17th, 2022
  39. Time extensions are an unsung hero of Active Support Oct 3rd, 2022
  40. Use before? and after? Methods When Comparing Dates and Times in Rails Sep 19th, 2022
  41. The Mrs Triggs Problem May 16th, 2022
  42. Know what your scopes are doing: where.first vs find_by Mar 14th, 2022
  43. Software & Infrastructure we use to Run Our SaaS Jan 31st, 2022
  44. Enqueue Jobs Quickly with Sidekiq’s Bulk Features Jan 24th, 2022
  45. Tidy Up Your Routes with Only Dec 6th, 2021
  46. Don't Use Floats and Use the Ruby Money Gem to Represent Currencies Nov 15th, 2021
  47. Use Sidekiq Directly, Not Through Active Job Oct 4th, 2021
  48. Use compact_blank to remove empty strings from Arrays and Hashes Sep 20th, 2021
  49. Compress Your HTML Responses Aug 30th, 2021
  50. Don’t call a new version of something ”new” when refactoring Aug 2nd, 2021
  51. Calculate the standard deviation of a Ruby array Jun 28th, 2021
  52. Calculate the mode & median averages of a Ruby array Jun 21st, 2021
  53. Opt out of Google’s FLoC User Tracking on Netlify May 24th, 2021
  54. Opt out of Google’s FLoC User Tracking in Rails May 24th, 2021
  55. Wrap your environment variables in a settings object May 10th, 2021
  56. Order by created_at and updated_at with scopes and a concern Apr 26th, 2021
  57. Do not use .all without pagination or a .limit Apr 12th, 2021
  58. Be specific when defining your routes Mar 22nd, 2021
  59. Turn off the bits of Rails you don't use Mar 8th, 2021
  60. Use Rails URL helpers outside views and controllers Feb 22nd, 2021
  61. Use Enhanced Memoization for false/nil with defined? Feb 8th, 2021
  62. Convert a two character ISO country code to an emoji flag Feb 1st, 2021
  63. Memoize Expensive Code Jan 25th, 2021
  64. Alt:BrightonRuby: An Online Ruby Conference — June/July 2020 Apr 26th, 2020
  65. ‘Fix’ first & last by explicitly setting implicit ordering Mar 1st, 2020
  66. All Your Mailer Views in One Place Feb 16th, 2020
  67. Calculate a mean average from a Ruby array Feb 2nd, 2020
  68. Be Suspicious of Join Tables Jan 20th, 2020
  69. Use Loose Ruby Versioning in Your Gemfile Dec 15th, 2019
  70. Ensure you correctly build your caching keys Dec 1st, 2019
  71. Write One Test Nov 17th, 2019
  72. Use GitHub Actions for Rails CI with Postgres Nov 3rd, 2019
  73. Use Active Support in Rails for deprecation messages Oct 20th, 2019
  74. A Active Model validator for Stripe Ids Sep 22nd, 2019
  75. Use a custom validator Sep 8th, 2019
  76. Clamp for min/max values Aug 11th, 2019
  77. Consider Value Objects Jul 28th, 2019
  78. Using strftime in a Rails view is probably a mistake Jul 14th, 2019
  79. Don’t Email From Active Record Callbacks Jun 2nd, 2019
  80. Watch Out For nil in Ranges May 19th, 2019
  81. Be Aware of nil values when using where.not() Apr 28th, 2019
  82. Prevent Links in Text Fields to Foil Spammers Apr 14th, 2019
  83. Protect your sign up form with Rack::Attack Mar 24th, 2019
  84. Clean up broken .dev domains Mar 13th, 2019
  85. Don't use instance variables in partials Mar 10th, 2019
  86. Secure Your Rails Staging Environment with HTTP Basic Authentication Feb 24th, 2019
  87. Be Careful Assigning to has_one Relations Feb 10th, 2019
  88. Replace Timecop With Rails’ Time Helpers in RSpec Jan 27th, 2019
  89. Use Multiple Migrations When Adding Database Constraints Jan 13th, 2019
  90. Always Force Booleans to be True or False Dec 17th, 2018
  91. Write long strings with wiggly HEREDOCs Dec 2nd, 2018
  92. A scope should return a scope Oct 14th, 2018
  93. Don’t Loop & Do Work in Jobs Sep 30th, 2018
  94. Using pluck can save a bunch of memory Sep 16th, 2018
  95. Careful with present? when using ActiveRecord scopes Sep 2nd, 2018
  96. Use the presence method Aug 19th, 2018
  97. Delegate to simplify your code Aug 5th, 2018
  98. Ignore PHP bots with Rack::Attack Jun 24th, 2018
  99. Use beginning and end of string in regular expressions Jun 10th, 2018
  100. Active Record’s first and last may not mean what you think May 27th, 2018
  101. A job should know whether to run itself May 13th, 2018
  102. Use Hash#fetch when using Rails params in controllers Apr 29th, 2018
  103. Stop robots and crawlers causing errors in your Rails application Apr 15th, 2018
  104. Check Your Database Indexes For ActiveRecord Scopes Mar 18th, 2018
  105. Only use named scopes outside models Mar 4th, 2018
  106. Avoid Writing SQL When Using ActiveRelation Feb 18th, 2018
  107. Enumerable avoids using temporary variables when looping Feb 5th, 2018
  108. Extract conditionals into well-named methods Jan 21st, 2018
  109. Be sparing when using unless Jan 7th, 2018
  110. Truthiness in Conditionals Dec 31st, 2017
  111. Set your page title in the view template using content_for Dec 11th, 2017
  112. Choose UUIDs for model IDs in Rails Nov 26th, 2017
  113. Use a pull request template Nov 12th, 2017
  114. Use simplecov in your Rails test suite Oct 29th, 2017
  115. Rescue specific errors. Avoid rescuing StandardError. Don’t rescue Exception. Oct 15th, 2017
  116. Don’t use default_scope. Ever. Oct 1st, 2017
  117. Use Rails’ naming conventions for dates & times Sep 29th, 2017
  118. Rails Naming Cringes Oct 13th, 2016
  119. AMP Project Pages on Ruby on Rails Sep 24th, 2016
  120. Simple Ruby/Rails Setup on macOS May 5th, 2016
  121. Benchmarking each_with_object Against inject when building Hashes from Arrays Oct 21st, 2014
  122. Serving a Jekyll Blog using Heroku Jan 19th, 2014
  123. Web Services used at ImpulseFlyer Jun 8th, 2012
  124. RedDotRubyConf 2012: Wrap up May 22nd, 2012