<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://bridgetownrb.com/" version="2.1.1">Bridgetown</generator><link href="https://petr.codes/feed.xml" rel="self" type="application/atom+xml" /><link href="https://petr.codes/" rel="alternate" type="text/html" /><updated>2026-02-14T20:20:40+01:00</updated><id>https://petr.codes/feed.xml</id><title type="html">Petr Hlavicka</title><subtitle>Product-minded software engineer. Web application development.</subtitle><author><name>Petr Hlavicka</name></author><entry><title type="html">Versioning API requests</title><link href="https://petr.codes/blog/rails/versioning-api-requests/" rel="alternate" type="text/html" title="Versioning API requests" /><published>2025-06-23T00:00:00+02:00</published><updated>2025-06-23T00:00:00+02:00</updated><id>https://petr.codes/blog/rails/versioning-api-requests</id><author><name>Petr Hlavicka</name></author><category term="rails" /><category term="api" /><category term="versioning" /><summary type="html">Learn how to handle API request versioning in Rails without duplicating controllers, using a schema-based approach that supports OpenAPI documentation and seamlessly maps external API structures to internal models.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/versioning-api-requests-v1.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/versioning-api-requests-v1.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Flexible API Versioning with Rails</title><link href="https://petr.codes/blog/rails/flexible-api-versioning-with-rails/" rel="alternate" type="text/html" title="Flexible API Versioning with Rails" /><published>2025-02-09T00:00:00+01:00</published><updated>2025-02-09T00:00:00+01:00</updated><id>https://petr.codes/blog/rails/flexible-api-versioning-with-rails</id><author><name>Petr Hlavicka</name></author><category term="rails" /><category term="api" /><category term="versioning" /><summary type="html">A well-defined API versioning strategy is crucial for any API expected to evolve. Let&apos;s explore the most common API versioning strategies and develop a flexible one in Rails.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/flexible-api-versioning-v3.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/flexible-api-versioning-v3.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Gem Credentials Management with Gemstash</title><link href="https://petr.codes/blog/ruby/gem-credentials-management-with-gemstash/" rel="alternate" type="text/html" title="Gem Credentials Management with Gemstash" /><published>2023-11-13T00:00:00+01:00</published><updated>2023-11-13T00:00:00+01:00</updated><id>https://petr.codes/blog/ruby/gem-credentials-management-with-gemstash</id><author><name>Petr Hlavicka</name></author><category term="ruby" /><category term="gems" /><category term="gemstash" /><summary type="html">How can we efficiently manage gem credentials across the team? When your project grows, you may reach out to commercial gems for help or want to extract some business logic into private gems.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/gems-credentials-with-gemstash.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/gems-credentials-with-gemstash.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Business logic in Rails with operators</title><link href="https://petr.codes/blog/rails/business-logic-with-operators/" rel="alternate" type="text/html" title="Business logic in Rails with operators" /><published>2021-10-19T00:00:00+02:00</published><updated>2021-10-19T00:00:00+02:00</updated><id>https://petr.codes/blog/rails/business-logic-with-operators</id><author><name>Petr Hlavicka</name></author><category term="ruby" /><category term="rails" /><category term="business logic" /><category term="poro" /><summary type="html">Having a thousand lines long controllers and/or models is not the right way to have sustainable applications or developers&apos; sanity. Let&apos;s look at this straightforward solution for business logic in the Rails app.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/rails-business-poro.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/rails-business-poro.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Fun with Rails Enums and PORO</title><link href="https://petr.codes/blog/rails/fun-with-enums-and-poro/" rel="alternate" type="text/html" title="Fun with Rails Enums and PORO" /><published>2021-10-05T00:00:00+02:00</published><updated>2021-10-05T00:00:00+02:00</updated><id>https://petr.codes/blog/rails/fun-with-enums-and-poro</id><author><name>Petr Hlavicka</name></author><category term="ruby" /><category term="rails" /><category term="enum" /><category term="poro" /><summary type="html">I really like enums. They can be really powerful if they are used wisely. Let&apos;s see what we can do with them in a multilingual Rails app with a little help from PORO (Plain Old Ruby Object).</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/rails-enums.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/rails-enums.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Multi-Factor Authentication for Rails with WebAuthn and Devise</title><link href="https://petr.codes/blog/rails/multi-factor-2fa-authentication-rails-webauthn-devise/" rel="alternate" type="text/html" title="Multi-Factor Authentication for Rails with WebAuthn and Devise" /><published>2021-09-27T00:00:00+02:00</published><updated>2021-09-27T00:00:00+02:00</updated><id>https://petr.codes/blog/rails/multi-factor-2fa-authentication-rails-webauthn-devise</id><author><name>Petr Hlavicka</name></author><category term="ruby" /><category term="rails" /><category term="devise" /><category term="webauthn" /><category term="2fa" /><category term="mfa" /><category term="security keys" /><summary type="html">There are several ways to add multi-factor authentication (MFA) for safer user authentication. Let&apos;s look at how to add a modern MFA approach to a Rails application with WebAuthn.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/devise-webauthn/devise-webauthn.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/devise-webauthn/devise-webauthn.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Modern Rails flash messages (part 3): Refactoring with Turbo</title><link href="https://petr.codes/blog/rails/modern-rails-flash-messages/part-3/" rel="alternate" type="text/html" title="Modern Rails flash messages (part 3): Refactoring with Turbo" /><published>2021-07-07T00:00:00+02:00</published><updated>2021-07-07T00:00:00+02:00</updated><id>https://petr.codes/blog/rails/modern-rails-flash-messages/part-3</id><author><name>Petr Hlavicka</name></author><category term="rails" /><category term="ruby" /><category term="stimulus" /><category term="turbo" /><summary type="html">Several things have happened since the first part. Like Turbo. The demo application still works, but a few changes needed to be made to support Turbo.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/mrfm/part-3.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/mrfm/part-3.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">How to generate sitemap.xml with Bridgetown</title><link href="https://petr.codes/blog/bridgetown/sitemap-generation/" rel="alternate" type="text/html" title="How to generate sitemap.xml with Bridgetown" /><published>2021-03-28T00:00:00+01:00</published><updated>2026-02-13T00:00:00+01:00</updated><id>https://petr.codes/blog/bridgetown/sitemap-generation</id><author><name>Petr Hlavicka</name></author><category term="bridgetown" /><category term="sitemap" /><summary type="html">During playing with Bridgetown (that I am using on this site), I needed to add a sitemap.xml file for search engines.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/bridgetown/sitemap.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/bridgetown/sitemap.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Using Dokku with Let’s Encrypt wildcard certificate</title><link href="https://petr.codes/blog/dokku/wildcard-certificate/" rel="alternate" type="text/html" title="Using Dokku with Let&apos;s Encrypt wildcard certificate" /><published>2021-03-21T00:00:00+01:00</published><updated>2021-03-21T00:00:00+01:00</updated><id>https://petr.codes/blog/dokku/wildcard-certificate</id><author><name>Petr Hlavicka</name></author><category term="dokku" /><category term="lets encrypt" /><category term="wildcard" /><summary type="html">Wildcard certificates are handy and this was the first time when I needed to use them with Dokku. It was a little bit harder than I expected, but luckily, it is doable even with automatic renewal.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/dokku/wildcard-certificate.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/dokku/wildcard-certificate.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Modern Rails flash messages (part 2): The undo action for deleted items</title><link href="https://petr.codes/blog/rails/modern-rails-flash-messages/part-2/" rel="alternate" type="text/html" title="Modern Rails flash messages (part 2): The undo action for deleted items" /><published>2020-09-20T00:00:00+02:00</published><updated>2020-09-20T00:00:00+02:00</updated><id>https://petr.codes/blog/rails/modern-rails-flash-messages/part-2</id><author><name>Petr Hlavicka</name></author><category term="rails" /><category term="ruby" /><category term="sidekiq" /><category term="stimulus" /><summary type="html">In the previous article, I&apos;ve prepared a way how to add actions to the Rails flash messages. In this article, I will explore one way how to use them for the undo action for deleted records.</summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://petr.codes/images/posts/mrfm/part-2.jpg" /><media:content medium="image" url="https://petr.codes/images/posts/mrfm/part-2.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>