Ruby on rails

Crafting A RESTful Ruby on Rails API

APIs have become a major cornerstone of Internet systems, as the interconnectivity of web applications, brick-and-mortar businesses, and services have dramatically increased over the last decade. API's can bolster a business's relevance and long-term survival and can often be a new source of income. But to be successful, you need a well-designed API that is designed for optimum return on investment. A poorly designed API can lead to costly support calls from API customers as they inquire about help integrating, or complain about API changes that you made, breaking their own costly integrations--they often will hire developers to do a custom integration--thwarting their ability to access data. To optimize your API, its needs to be RESTful and, in this guide, we'll use Ruby on Rails, which was originally designed for API usage from the start.

Read more
Ruby on rails

Using Ruby on Rails Active Storage on Digital Ocean

Active Storage is a new feature of Ruby on Rails 5 for handling image and file attachments. It replaces the need for using external image handing gems such as tried and sturdy Paperclip, which is now deprecated. Active Storage has been well thought through, allowing for much greater on-the-fly flexibility. In this post, I'll show you how to configure Active Storage, using Digital Ocean (referral link) Spaces as the file store.

Read more
Ruby on rails

Managing Application Secrets with Ruby on Rails Credentials

A crucial part of any production application is managing secrets, and Rails has taking numerous approaches and various capable gems have addressed the need. But now with Rails 5.2, managing application secrets in Ruby on Rails applications is now easily achieved and accomplished through the use of Rails credentials. This new approach is the simplest and by convention, allows for the committing of encrypted secrets into a code repository, but avoiding the committing of the master key. Read on to get started on using this new approach.

Read more
Ruby on rails

Tips & Tricks with Fixtures

Fixtures have long been a great element of Ruby on Rails and I like getting the most out of them. There are lots of tools that you can tack on that might make them more shiny or do one more thing, but on their own, they do a great job and in most cases, you really don't need anything else for loading data for tests. Read on for all the basics, and also a few tips that make using them all that much easier!

Read more
Ruby on rails

How To Build Your Own Authentication in Rails 5

Here's a quick tutorial on rolling your own authentication in a Ruby on Rails application, rather than using often-over-engineered gems like Devise, which are awesome, but often do too much, and are hard to work with if you want to do any modifications to conventional login behaviors. Rails already has built in authentication called has_secure_password, which handles password encryption and decryption.

Read more