---
title: 'This week in #dev (Jan 9, 2026)'
teaser: 'Overriding Rails credentials, a helper to submit forms with images and how
  to count tests with rspec''s --dry-run option.

  '
tags: this week in dev,til,testing,rails
author: thoughtbot
published_on: 2026-01-19
---

Welcome to another edition of [This Week in #dev](https://thoughtbot.com/blog/tags/this-week-in-dev),
a series of posts where we bring some of our most interesting Slack
conversations to the public.

## Overriding Rails Credentials with Environment Variables

[Rob Whittaker][rob] shares an article that demonstrates how you can override
Rails credentials with environment variables using the [Rails 8.2
`Rails.app.creds` accessor][creds]. This can be useful for [building a feature
flag system][ff]:

```yaml
features:
  dark_mode: false
```

To enable dark mode, use:

```bash
FEATURES__DARK_MODE=1 ./bin/rails server
```

[creds]: https://github.com/rails/rails/pull/56404
[ff]: https://codewithrails.com/blog/rails-feature-flags-credentials/
[rob]: https://thoughtbot.com/blog/authors/rob-whittaker

## The Rails `image_submit_tag` helper

[Matheus Richard][matheus] learned about [Rails' `image_submit_tag`][image_submit_tag], a helper
that displays an image which when clicked will submit the form.

```rb
image_submit_tag("login.png")
# => <input src="/assets/login.png" type="image" />
```

[image_submit_tag]: https://api.rubyonrails.org/v8.1.2/classes/ActionView/Helpers/FormTagHelper.html#method-i-image_submit_tag
[matheus]: https://thoughtbot.com/blog/authors/matheus-richard

## Counting Tests with RSpec's `--dry-run` Option

[Justin Toniazzo][jt] shares a tip about using `rspec --dry-run` to list all
tests without executing them. This can be useful for quickly determining the
number of tests in a codebase:

```bash
bin/rspec --dry-run --format json | jq '.examples | length'
```

[jt]: https://thoughtbot.com/blog/authors/justin-toniazzo

## Thanks

This edition was brought to you by [Justin Toniazzo][jt], [Matheus Richard][matheus], and [Rob Whittaker][rob]. Thanks to all contributors! 🎉
