The bin/dev script Ruby on Rails ships with, if you for example init the app with --css=tailwind or --css=bootstrap is great. It comes with auto-generated Procfile that will launch the web server and the Tailwind CSS (or other) preprocessors. In addition bin/dev will install the foreman gem if it does not exist on your system.
Contribution to Rails documentation
I got my first contribution to Rails codebase merged last week. It’s an improvement to documentation, that explains how to fully utilise parametric scopes.
Scaffolding in Rails 7 is amazing
I’m continuously being impressed by the productivity and ease of use enhancements Rails keeps making after all these years it has been around.
Easily switch or experiment with different databases in Rails
I just learned about rake db:system:change task that Rails provides, to speed up switching between different database engines. If you’re experimenting with something, or benchmarking things, this is super useful.
Starting new Rails applications
It’s been a while since I reviewed the documentation for rails new console command. There are a few useful features that I didn’t know about:
Speeding up office work with Ruby and IRB
I was just paying taxes ?. One of the steps involved was copying and pasting a few long reference numbers from a PDF into my banking app. The thing is, when copied, the reference number would contain extra spaces, after each character, making it invalid where I needed to paste it.
Who is this feature for?
In software development, when thinking about and designing new features, or trying to solve existing issues, it’s important to, early, ask the question: Who is this feature for?
Don’t forget about X-Forwarded-Host header
Recently I was working on a Rails application on Heroku living behind a reverse proxy. This application serves requests coming to a specific folder on the target domain. For it to correctly generate full URLs, you have to somehow tell this app the hostname you want it to use. In Rails, you can configure a hostname in the environment config file, but that’s a static value, which has to be maintained and changed per environment. Also it does not work well if you want to access the application from multiple domains.
Web technology apps taking over?
It’s interesting to see that my 3 most used desktop apps, during my day to day computer use, are all web technology based:
CRM system
Integrated business management web app for a sales company with CRM features. The functionality this Rails app provides is extensive: