Web apps built with Ruby on Rails
weuserails.com
weuserails.com
Last month, I built a directory of web apps built with the Rails framework.
With Rails 8 released last year, the framework is stronger than ever. Some even say it’s experiencing a renaissance.
There are already 21 submissions, and if you use Rails, you’re welcome to add your app or website!
I'm just curious, how well does Ruby integrate with AI tools?
If Python is an extremely popular programming language people like to write about using (it is), you'll expect a lot of people to state that Python is their most proficient language and for that to make its way into the training data. When you ask the LLM, you'll get Python as an answer some fraction of the time and other languages some other fraction.
Those answers are orthogonal to how good the LLM actually is though. In the training data, you'd like a sufficiently robust sample of code (which Python should have) without most of the code being terrible (which Python doesn't have in the wild).
Mind you, IME they do better with Python than very new languages, and they do better with Python tooling than whatever maven build garbage you might have to deal with, but that's faint praise.
Unit tests are a major win for LLMs.
It seems to understand the way you want your unit tests written. So if you have a particular style, it's best to write one or two tests in your style, then it will use that same style when it starts writing tests.
You can do prompts like "I need unit tests for the exceptions that are raised in the SuchAndSuch.function()", and it will do it -- particularly if you have a unit test already written similar to what you'd like.
I haven't done any AI with Ruby, but from what I saw, the ecosystem is lacking support of good libraries.
From what I know (please correct me if I am wrong) most people use AI to create scaffolding and automate all boring and repetitive tasks in a project. So code still needs to be written, you just outsource it to AI helper.
In Rails you write less code and concentrate on business logic because everything boring like DAL, authorization, caching is already written and tested in production.
edit: syntax
Generally speaking you will find Rails being used more in Business or SaaS rather than consumer.
Really love that it seems to just be a complete toolbox, especially for a solo project.
Also seeing more and more rails roles out there, but obviously don't have 5+ years with the framework
I'm not a big fan of watching tutorials, but more of learning by doing but I signed up for https://gorails.com when I started out and it was very helpful to get an overview.
Does anyone here have any recommendations for free or at least very cheap Rails hosting for a toy app just for learning purposes? I’m looking for a PaaS offering since I don’t have the time to secure and manage a VPS.
Should also point out the recently released Rails 8, has as key features focussed on making rails much easier to deploy to anywhere that supports Docker.
You'll still be spinning up a VPS, but at least set up and management is done via a very heroku-like interface from your local machine. Just get any VPS that will be accessible via SSH, and `kamal setup` can handle the rest. [1]
The one annoying part right now, is it relies on a docker registry you have to provide. I think they're working on removing that requirement, but you can use the free github container registry until then. It's just for rollbacks AFAIK.
I think the pendulum is kind of swinging back the other way now. While there are certainly advantages with the Node ecosystem, it always felt very messy to me. Rails language extensions, ORM, testing, and migrations frameworks have never been matched by any javascript libraries. Ruby and Rails have always prioritized quality of life features, which made it a very enjoyable and productive framework.
I also think the language itself is a big plus. I don't like the reflection system or hot patching being a feature in a language, but rails makes extensive use of it to create it's own domain specific language.
And do sometimes think of small apps i could build for fun, but the thought of doing react, again, is tiring in and of itself lol plus the whole setup around getting express running and picking packages.
Rails is ready out of the box, for me to not have to screw around with.
Just love the ruby syntax(along with python, which i am actively learning now with datacamp). Its cleaner, and i can probably do 90% of what i do in react there. Then for the rest throw solid js or svelte, or even just react for specific components.
I know sqlite3 is great, but I've always found it much more annoying to use it on a server for small side projects than just using Postgres where I could just connect to the prod instance from my local machine and run some queries to look at the data. With sqlite I'd always have to sync files, set up volumes, make sure permissions are correct vs. just setting an environment variable to a PG instance.
I do share your preference on using Postgres as the main database. Having that as the main db with sqlite3 used for auxiliary functionality sounds great.
ssh your-server sqlite3 /tmp/path/to/your/db.sqlite3
Or if you're using Kamal, then the choice of database is completely transparent: kamal app exec -i --reuse bin/rails consoleIt cuts through all the mess of modern web development so well and makes turning an idea in to something deployable incredibly easy.
...but as someone using it in Anger for a few years now, I long for the day I can say goodbye to it and never look back, for all the usual reasons.
But I disagree that it's consistent or that it leads to consistency.
The "Rails way" or "DHH way" of building apps is indeed consistent, but most big teams eschew this in the name of more complicated (and less consistently applied) patterns.
It follows the Anna Karenina principle to a T. All good codebases are alike and follow the Rails way; each bad codebase is bad in its own way and uses bullshit like Trailblazer, Active Interactors, over-engineered Service Objects or some other bullshit. Sometimes all of them at the same time.
The Rails part has been easy to maintain and adapt to users' frequent changes, the main issues being feature requests for very complicated queries which then end up being slow. Vue has taken up a lot of time with the migration from 2 -> 3 (still not finished).
I’ve been using rails for over 20 years and still love it but the JavaScript story has always been in flux in bad ways. I don’t like the turbo stuff or stimulus. Basically just want to be able to add some nice charts, and some enhancements like confirmation for links. Basically just build admins with it so the caching for partial html just isn’t part of the game. Looked at upgrading to rails 8 now but the javascript in last version of rails was fragmented and complicated, so looking to find a good way to do it in a standard way now, hopefully next version of rail’s doesn’t change everything again.
https://guides.rubyonrails.org/working_with_javascript_in_ra...
- Adding npm Packages with importmap-rails To add new packages to your import map-powered application, run the bin/importmap pin command from your terminal:
$ bin/importmap pin react react-dom
Then, import the package into application.js as usual:
import ReactDOM from "react-dom"
For me, Stimulus adds just the right amount of structure over Vanilla JS.
And Turbo/Hotwire feels like building skyscrapers with wood vs. steel.
* Prototype
* Asset pipeline
* Webpacker
* Importmaps
You do have to pick an auth lib (most use Next-Auth aka Auth.js) but Rails needed auth lib until Rails 8 a couple months ago.
The traction behind Next.js is so large, it's much bigger than Rails, Django, and Laravel for new projects the last couple years: https://trends.stackoverflow.co/?tags=next.js,ruby-on-rails,...
I've been working on a membership management platform [1] using Rails + Hotwire Turbo & Stimulus and I can't imagine how long it would have taken me using other frameworks around.
Want a rich text editor? Just use action text. Want document storage? Active storage is easy. Job queues? Mailers? Caching? Integration testing? All easy to do.
I love that Rails is "omakase", once you lean into the ecosystem it's great that most things just... work.
2) It's battle-tested. Tried and true. Batteries included. Can have a web app with most functionality needed running in minutes.
3) There are more reasons, but there are other good options as well. No reason to use Rails if you're not interested in Ruby.
this is the Python standard library motto
Anyway, Ruby & Rails are such a joy to use that, at least for me, the fact that it’s written in a different language than the one we need in the browser is a non-issue.
Today I stick with Ruby and Rails. I am trying to do my context switching in the front-end JS frameworks but I just feel a bit dead doing it at the moment!
However, what shocked me, having come from a C/C++ background were the thousands of dependencies for the most simple of apps. This scared me as how could I possibly understand the security holes and inner workings of all these dependencies.
Another problem I ran into was the tendency of rails developers to create monolithic applications with little separation between the UI, middle tier layer, and the data model layer. When I would be writing client side apps and interfacing with rails back ends, The rails teams would always implement new functionality into the website and then separately add functionality to an API. I think this comes down to the way people learn to develop in rails as rails teaches a monolithic method. I would always try to point out that creating an API where all of the logic was held, would make life so much easier for them, and they would agree, but continue to build The monolithic website with a separate API.
Is Rails better in this respect?
The key to maintaining a healthy Rails codebase is to make most of your code independent of Rails. Rails is great at the basics: Handling requests and composing views. It's okay at storage stuff. But it's not good at handling complex usecases, managing JS, etc.
This isn't to say that you can't use Rails if you're making complicated stuff, or using JS, it just means you need to know when to keep your code to Rails's structures and when to write your own structures that you then invoke from within Rails.
It wont cover every use case but for what I do it's amazing.
I remember when I experienced exactly this, it kind of flipped switch in my head which made me love static typing.
There’s a great example on the home page here: https://rubyonrails.org/
oh deer.