RubyOnRails

Showing 1-9 of 13 results
EngineeringIcon ChevronTechnology

5 Things You Have Never Done with a REST Specification

by Alexander Zinchuk

The existence of RESTful APIs is a popular myth in web development—but it's a myth we can work with. The right tools can help keep documentation consistent and streamline automated testing. In this article, Toptal Freelance JavaScript Developer Alexander Zinchuk explores several time-saving approaches to developing REST APIs, with examples in Node.js and Ruby on Rails.

13 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 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

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

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
EngineeringIcon ChevronTechnology

The Publish-Subscribe Pattern on Rails: An Implementation Tutorial

by Ahmed AbdelHalim

The publish-subscribe pattern] (or pub/sub, for short) is a messaging pattern where senders of messages (publishers), do not program the messages to be sent directly to specific receivers (subscribers). Instead, the programmer "publishes" messages (events), without any knowledge of any subscribers there may be. This article provides insight in how to use the pub/sub pattern, in Rails, to communicate messages between different system components without these components knowing anything about each other's identity.

8 minute readContinue Reading
EngineeringIcon ChevronTechnology

A Guide to Rails Engines in the Wild: Real World Examples of Rails Engines in Action

by Joe James

Why are Rails Engines not used more often? I don't know the answer, but I do think that the generalization of "Everything is an Engine" has hidden the problem domains that they can help to solve.

11 minute readContinue Reading
EngineeringIcon ChevronTechnology

The Many Interpreters and Runtimes of the Ruby Programming Language

by Ryan Wilcox

Which Ruby implementation is right for your project? While the reference implementation (Ruby MRI) remains the interpreter of choice, an alternate Ruby implementation may be right for your project, depending on your operational goals and constraints. This article showcases the Ruby interpreter implementations and runtimes available today, discussing the advantages and disadvantages of each.

9 minute readContinue Reading
EngineeringIcon ChevronTechnology

Buggy Rails Code: The 10 Most Common Mistakes That Rails Developers Make

by Brian VanLoo

While Rails is easy to use, it is also not hard to misuse. This article looks at 10 common Rails pitfalls, including how to avoid them and the problems that they cause.

13 minute readContinue Reading

Join the Toptal® community.