Ruby on Rails

Showing 1-9 of 22 results
EngineeringIcon ChevronWeb front-end

Rails 6 Features: What's New and Why It Matters

by Avant Mittal

Rails 6 is finally here, featuring major improvements and clever new features that should make development easier and faster than ever. In this article, Toptal Ruby on Rails Developer Avant Mittal dives into the Rails 6 changelog to introduce you to these new features and explain how you will be using them in your next Rails project.

9 minute readContinue Reading
EngineeringIcon ChevronBack-end

Rails Service Objects: A Comprehensive Guide

by Amin Shah Gilani

Rails ships with everything you need to prototype your application quickly, but when your codebase starts growing, you'll run into scenarios where the conventional Fat Model, Skinny Controller mantra breaks. When your business logic can't fit in either a model or a controller, that's when service objects come in and let us separate every business action into its own Ruby object.

11 minute readContinue Reading
EngineeringIcon ChevronTechnology

Field-level Rails Cache Invalidation: A DSL Solution

by Orban Botond

Fragment caching in Rails provides an easy yet a powerful way of improving your application's performance. However, some real-world scenarios do not work quite well with how the Rails cache behaves by default. In this article, Toptal Ruby on Rails Developer Orban Botond shows how you can implement a small DSL to optimize how the cache for related entities is invalidated to improve template rendering performance.

7 minute readContinue Reading
EngineeringIcon ChevronTechnology

Meet Phoenix: A Rails-like Framework for Modern Web Apps on Elixir

by Eduardo Bautista

In back-end software development, increased productivity often comes at the cost of performance. In this article, Toptal Software Engineer Eduardo Bautista shows us how the Phoenix framework builds on the familiar concepts from the Rails world, and makes it even easier to build robust concurrent applications without compromising performance.

9 minute readContinue Reading
EngineeringIcon ChevronWeb front-end

Build Sleek Rails Components With Plain Old Ruby Objects

by Eqbal Quran

Your website is gaining traction, and you are growing rapidly. Ruby/Rails is your programming language of choice. Your team is bigger and you’ve given up on “fat models, skinny controllers” as a design style for your Rails apps. However, you still don’t want to abandon using Rails? No problem. In this article, Toptal Software Engineer Eqbal Quran explains how you can decouple and isolate your Rails components using nothing Plain Old Ruby Objects. Ruby objects and abstractions can decouple concerns, simplify testing, and help you produce clean, maintainable code.

18 minute readContinue Reading
EngineeringIcon ChevronTechnology

Clean Code and The Art of Exception Handling

by Ahmed AbdelHalim

Exceptions are as old as programming itself. An unhandled exception may cause unexpected behavior, and results can be spectacular. Over time, these errors have contributed to the impression that exceptions are bad. But exceptions are a fundamental element of modern programming. Rather than fearing exceptions, we should embrace them and learn how to benefit from them. In this article, we will discuss how to manage exceptions elegantly, and use them to write clean code that is more maintainable.

12 minute readContinue Reading
EngineeringIcon ChevronTechnology

Grape Gem Tutorial: How To Build A REST-Like API In Ruby

by Orban Botond

In this tutorial, Toptal Engineer Orban Botond demonstrates how to use the Grape gem -- a REST-like API micro-framework for Ruby -- to build backend support in Rails for a JSON API. Grape is designed to run as a mountable rack engine that complements your web applications without interfering with them.

15 minute readContinue Reading
EngineeringIcon ChevronTechnology

Building a Color-based Image Search Engine in Ruby

by Nazar Hussain

With modern image editing tools, we often take for granted the ability to extract or identify color on some part of any image. However, doing it programmatically is not exactly so straightforward. Camalian, a Ruby gem, changes that, making extracting and manipulating colors in an image as easy as possible. In this article, Toptal engineer Nazar Hussain provides some insight into how various color spaces work, introduces Camalian, and gives an overview of how to use it to build a color-based image search engine in Ruby.

7 minute readContinue Reading
EngineeringIcon ChevronTechnology

How to Use Rails Helpers: A Bootstrap Carousel Demonstration

by Carlos Ramirez III

One of the most misused, misunderstood, and neglected of all the Rails built-in structures is the view helper. Helpers often get a bad reputation for being a dumping ground for one-off methods used across the entire application's view layer. But what if your helpers could be more semantic, better organized, and even reusable across projects? What if they could be more than just one-off functions sprinkled throughout the view, but powerful methods that generated complex markup with ease leaving your views free of conditional logic and code? Let's see how to do this when building an image carousel, with the familiar Twitter Bootstrap framework and some good old-fashioned object-oriented programming.

7 minute readContinue Reading

Join the Toptal® community.