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
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Rails comes packed with a lot of useful conventions. However, it doesn’t say much about how we should organise our front end assets. Here is a way in which we can leverage the same conventions we use to organise our controllers and views to have a neatly organised assets directory. [more inside]
Today I woke up wanting to start a discussion about what it takes to be an awesome software engineer. I constantly see recruiters evaluating candidates solely based on their programming skills. Hence, most developers focus only on learning the latest programming language out there. Is that all it takes? Here’s my two cents on the matter. [more inside]
In ruby a lot can be achieved in a single line of code. Defining our own getters and setters is usually done when we need custom behavior for all other cases there is already something built in ruby. We’ll cover attr_reader, attr_writer and attr_accessor in this post.
The open-source community has done a great job of promoting good documentation as a necessary trait for the success of a software project, whether it be a utility library, a larger framework or a standalone program. In my latest article I explain how we can take it one step further and also use error messages to educate our users.
Implementing various methods of caching in Rails is relatively simple, and in most basic cases Rails handles cache invalidation out of the box or with minimal code. But when using many-to-many associations, propagating changes in one object to all its associated objects needs some setting up so that Rails can handle cache invalidation. In “Invalidating caches when using many-to-many associations in Rails,” I talk about various methods of achieving this, and why one should choose one over the other.
My friend Will Glynn and I worked on a project recently that allows you to type out and execute Ruby code without ever leaving the browser. It’s Ruby 2.6.0 compiled to WebAssembly! We call it run.rb and pronounce it “runner bee.” Our next goal is to add the standard library to the website. Please give it a spin and let us know what you think! I wrote up a quick explanation of why I wanted to build it here. I’d love any ideas of how we can make it better. ❤️
Some developers argue on the real value of testing Rake tasks since they’re only used once or on rare particular occasions. Others think it’s enough to extract all the logic out of them to properly tested objects (we’ll look into that later). Before fully diving into the question of how to test them (and if it’s really worth it), we’ll take a quick look at Rake tasks themselves. [more inside]
Introducing - Lit 1.0: A reworked i18n Ruby gem that will make your web app’s translation a lot easier. https://prograils.com/posts/lit-rails-internationalization-i18n-new-way-of-translating-rails-apps
A list of the deprecations that are listed in the CHANGELOG.md of the Ruby on Rails 6.0Beta1 release. https://blog.driftingruby.com/ruby-on-rails-6-0-beta-1-deprecations/
An overview of how Handshake is adopting GraphQL while breaking apart its Rails monolith to a set of smaller applications focused on serving specific user types. https://medium.com/rubber-ducking/adopting-graphql-and-transitioning-to-domain-driven-services-ea51309f95f7
What does it take to put together a modern single-page web app using Vue.js on the frontend and Rails as the backend API? The Pragmatic Studio unpacks the design, architecture, and implementation of a full-stack application so you understand how everything works together. No need to get bogged down in figuring out how to put all the pieces together yourself. https://pragmaticstudio.com/courses/unpacked-single-page-app-with-vue-rails