Weekly Brain Dump #46
At a Glance
- The Write Clean Renamed sessions and added logging
- Taylor Mentions! Taylor was mentioned in two lightning talks!
- Ruby Webring Taylor got into the Ruby webring
- Interesting Links Cool things I found this week
- Comments
The Write Clean
I’ve made a little progress on this, I was held back by the way Opal deals with promises. Essentially I had a form and I wanted to display the errors, so I did the following:
# Controller
class WritingSessionsController < ApplicationController
def create
respond_to do |format|
session = project.writing_sessions.create(session_params)
format.json do
if session.valid?
render json: session
else
render json: session.errors, status: :unprocessable_entity
end
end
end
end
end
# Modal
class Project
class Writing
class LogSessionModal
include Unhinged::Component
def submit(event)
event.JS.preventDefault
@state = :submitting
@project.create_writing_session(@data).then do |response|
@state = :waiting
close
end.catch do |error|
@state = :waiting
@data[:errors] = error.JS[:response]
end
end
end
end
end
The part that took me forever to figure out was error.JS[:response] since Opal
populates error with an Exception and the message is the “text” returned,
which in this case was coming back as [Object object] since it was a Ruby
hash.
This sort of discoverability is what is making Opal difficult to work with at times. I’m still really enjoying it and think it’s worth the battle as the code I’m writing is coming out a lot more maintainable and is actively enjoyable to write.
Again, you can check out Unhinged if you’re curious. I think it’s interesting but it’s still a ways off being production ready for others.
Taylor Mentions!
During the Rocky Mountain Ruby 2026 Lightening Talks, there were two different talks that mentioned Taylor!
Marc Heiligers, Ruby Everywhere
It will never stop blowing my mind that there are people out there in the world using something I made.
Ruby Webring
I applied to have the Taylor website add to the Ruby Webring and got accepted! I added it to the footer and am excited to get even more people using and talking about Taylor.
Interesting Links
A few of my favorite software documentaries: I haven't seen most of these but I love a good tech documentary.
Keep pairing with humans: My coworker wrote an article and it's really interesting
Cozy Handheld Bundle: Grab some cosy little homebrew Gameboy games for a good price.
Rails is a JIT compiler: An optmisation deep dive into how Rails does meta-programming.