Systems | Development | Analytics | API | Testing

Rails

A Guide to Rails View Helpers

Views in Rails don't do much besides showcasing what we want. Sure, they might render slightly different results depending on who's watching (an admin or a logged-in user has a different experience than a guest user, for example), but they don't do much processing on what they're given. Or at least they shouldn't. Often though, Rails projects wind up with a lot of logic in their views. In this post, we'll explore how to use Rails helpers to keep our views clean and readable.

Rails ActionCable - the good and the bad

ActionCable allows developers to move away from the typical request/response paradigm of old to one where persistent WebSocket connections are maintained from clients to your Rails servers. Event-driven and low-latency, WebSockets are an excellent choice for use cases like live chat, alerts & notifications, and realtime data broadcast.

Create a Business Language for a Rails Application

As web developers, we tend to approach problems with traditional low-risk solutions. When all you have is a hammer, everything looks like a nail. When you need complex input from the user, you use a form and JSON representation (even if, in retrospect, it is not the most efficient solution). In this post, we'll take a different approach. We'll leverage some tooling to create a business language that extends the functionality of a Rails application. Let's get started!

Database Performance Optimization and Scaling in Rails

Web applications usually rely heavily on databases, for the most part. And as applications grow, databases grow too. We keep scaling web servers and background workers to keep up with the heavy load. But eventually, the database needs to keep up with all the new connections from these processes. One way to tackle this is to grow a database with an app using vertical scaling. This means adding more CPU power and memory to the database server. But this is usually slow.

What is Migration in Rails?

Migration in Rails is a tool that allows the developer to use Ruby to change an application's database schema. Instead of using SQL scripts, we use Ruby code, which is database independent, so it is easy to move the application to a completely new platform. We define these database changes in domain-specific language (DSL), and these migrations can be rolled back and managed along with the application source code.