Commit Redux

A software development blog in commit-sized retrospectives

ActionView in Sinatra, and this blog's name

Wednesday May 07 2025 • 03:05 AM

The blog’s main writing space is a textarea element. When rendering posts, I’m outputting things without line breaks. Last night I solved this same problem over on Rails using the simple_format helper from the ActionView library.

To make the helper available in Sinatra, I imported the ActionView gem and activated the Sinatra helper block to make it and other helpers like truncate() available in my ERB templates.

I’m not entirely sure it’s worth it to bring the whole library since the goal is to keep a minimal footprint, but it also doesn’t make sense to reinvent the wheel for such simple things. Maybe I’ll come back to this.

Also, I like the name Commit Redux for this blog, but (My) Last Commit is also pretty good.