The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Using OmniAI to Convert PDFs to Markdown with LLMs
A guide to converting a PDF into Markdown using OmniAI with OpenAI and MuPDF. https://workflow.ing/blog/articles/using-omniai-to-convert-pdfs-to-markdown-with-llms
How to load a lazy loaded turbo frame a bit before it scrolls into view
A quick tip on improving lazy loaded turbo frames. Sometimes you want to start loading it a bit before it scrolls into view to provide a smoother UX: How to load a lazy loaded turbo frame a bit before it scrolls into view
10x Developer Puzzle, Solved!!!
Here is a thought! The mythical 10x Developer is simply a developer that eliminates 9/10 of unnecessary over-engineered code, and then writes the remaining 1/10 of the code needed at the productivity rate of a 1x Developer… Continue reading at: https://andymaleh.blogspot.com/2024/09/10x-developer-puzzle-solved.html
Take the Ruby Quiz
I just published a new Ruby Quiz. There are 10 questions randomly sampled from a bigger set, so every time you reload the page, you will get a different quiz. Take the quiz, share your score and challenge your friends! :)
Say No To Partials And Helpers For A Maintainable Rails Front-End
After reading Garrett Dimon’s excellent post on effectively using partials and helpers, I wrote up my own take—avoid them entirely and use Phlex instead.
Debugging your code using a Tracepoint filter tool
Debugging big projects can be painful, so being able to automate this process would be amazing, right? rails_tracepoint_stack do it for you. https://rubygems.org/gems/rails_tracepoint_stack. See also https://blog.codeminer42.com/understanding-complex-rails-projects-ruby-on-rails-stack-trace-made-easy/
Dependent Fields with Hotwire
Large forms can be overwhelming to fill out, especially if not all of the fields are required. In this episode, we’ll look at creating a stimulus controller to conditionally display fields based on the input of another field. https://www.driftingruby.com/episodes/dependent-fields-with-hotwire
Rails 7.2 allow_browser version guard feature
Rails 7.2 introduced the allow_browser version guard feature, that allows you to specify the minimum browser versions your application supports. The default allowed versions are from December 2023, which seems a bit too restrictive. This short tutorial shows you how to use it.
Todo MVC Ruby Edition w/ Style Blocks + Inline-Style & Class-Inclusion Data-Binding
Todo MVC Ruby Edition is a Rails sample app that was built with Glimmer DSL for Web using Frontend Ruby. It has been refactored, simplified, and optimized significantly (all operations happen instantly now), relying on new Glimmer DSL for Web features, such as Style Blocks, Inline-Style Data-Binding, and Class-Inclusion Data-Binding. https://andymaleh.blogspot.com/2024/08/todo-mvc-ruby-edition-w-style-block.html
Mike Dalessio on HTML parsing & sanitization and SQLite
In this episode, hosts Chris and Andrew sit down with Mike Dalessio, a seasoned Ruby developer and contributor to numerous open-source projects. Mike shares his journey from his early days with Ruby, including his contributions to Shopify and pivotal projects like Nokogiri and Mechanize. The conversation also delves into the challenges and innovations in HTML sanitization in Rails, the evolution of SQLite gems, and the significance of managerial experience in enhancing software development skills. The episode wraps up with insights into the continuous improvements and collaborative efforts in the Ruby community. [more inside]
Speed-up rails test suites with self-hosted Github Actions runners
Hey, I’m a Rails developer with lots of interest in infrastructure. I’ve published a project that allows you to spawn much faster runners for Github Actions, self-hosted in your AWS account, and for much cheaper than official runners. Some users with heavy Rails codebases managed to save 80% of their cost, and most importantly greatly speed up their test suites. [more inside]
faker-ruby community's survey is live!
Hi folks! If you use faker in your Ruby app, could you help us make it even better? [more inside]
Are You Too Busy for Long-Term Indirect-Value Activities in Software Engineering?
Software Engineering activities are split between ones that provide direct value to customers in the short-term and ones that indirectly benefit customers in the long-term. It is important to have a good balance of both in order to ensure the long-term viability of Software Engineering work and continuously offer maximal value to customers. The best Software Engineers out there are those who have mastered the skill of balancing short-term direct-value activities with long-term indirect-value activities. [more inside]
Hotwire, but for command-line apps
I’ve been cooking up a new way to build command-line apps with Rails that I call Terminalwire. Similar to Hotwire, Terminalwire doesn’t need an API because it streams STDIO (and a few other channels) over WebSockets. This means you can use Thor, or any other Ruby command-line parser, to build out a CLI on the server and updates are automatically deployed when you deploy your Rails server. This will lower the bar for developers who want to deploy a CLI app, like Github & Stripe, without having to manage an API. [more inside]
Rails Generators Cheat Sheets
I created some high-level Rails Generator cheat sheets to help create a unified list of the available actions, inflections, and variables that work within Rails generators. It doesn’t provide documentation, but it’s handy for remembering the name of the action or variable when it’s on the tip of your tongue.
Easy to Overlook PostgreSQL Performance Issues in Rails Apps
Performance issues in the PostgreSQL layer usually start to manifest only when your app reaches a certain scale. In this blog post, I’ll discuss easy-to-miss database config tweaks and common problems that I’ve encountered in multiple Rails projects. [more inside]
How to test graphql-ruby responses
In this short post I’ll show you how I test responses from my backend powered by graphql-ruby.
Organizing Rails Code with ActiveRecord Associated Objects
The ActiveRecord::AssociatedObject
gem is a great tool to help organize logic that fits nicely into an encapsulated concept but only ever needs to interact with one type of object. I wrote a bit about our experience using it and the benefits we’ve seen.
Dev tools AI‑fication 101: lessons from Martian robots
Today, software engineers have GPTs, LLMs, RAGs, and even llamas (🦙 “mhe-e”) coming at them from every direction. Yes, it’s becoming normal for every service or tool to have some kind of special intelligence baked in. As developer tool builders, it’s natural to experience AI-FOMO. And if that’s you, don’t worry—we’re here to help. Read on to see how we approached the AI-ification of TestProf our Ruby test toolkit and start embracing LLMs today! [more inside]
Per Seat Pricing Sucks
Meaty post explaining thought process of pricing an app. [more inside]