Articles of interest for Ruby on Rails
Displaying articles 51 - 75 of 5374 in totalArticle Sources
-
API CRUD Actions
The core of any API wrapper is the actions for create, read, update, and delete. We'll implement the CRUD for a resource so you can see how to do it and wire up everything together that we've built so far.
Published:
-
Mapping API Resources & Handling Pagination
The core of an API wrapper Rubygem is defining the Resource endpoints so developers can make requests cleanly. We'll also learn how to handle pagination for endpoints that return a list of results.
Published:
-
Transforming JSON responses to Ruby objects with OpenStruct
When you receive a JSON response from an API endpoint, it's really easy to convert this to a Ruby hash. But hashes don't feel very Ruby-ish when you're working with them and you can't add methods and treat them like objects.
Published:
-
API HTTP Requests using Faraday
The first step in building an API wrapper Rubygem is building your HTTP client. We're going to use Faraday as our HTTP client and get it setup with authentication.
Published:
-
Rails Request.js Query Option
In this episode, we'll walk through how I discovered an improvement for Rails' new Request.js library and how we approached and implemented the feature in a pull request.
Published:
-
Dynamic Select Fields in Rails with Hotwire
Need to dynamically update fields when a user changes a select box? We can do that easily in Rails using Hotwire's Turbo Stream actions.
Published:
-
Dynamic Authorization Roles with Pundit
Want users to be able to define different roles for users on their account? You can easily accomplish this with a Role model and Pundit
Published:
-
HTTP Server from Scratch: Rack & Rails Support
Last episode, we built a multi-threaded HTTP server from scratch using Ruby. This week, we'll enhance our web server by adding Rack and Rails support.
Published:
-
HTTP Server in Ruby from Scratch
Ever wondered how Puma, Unicorn, or other Ruby HTTP servers work? We'll build one from scratch with pure Ruby so you can see exactly how it works.
Published:
-
How to deploy Rails to a Staging Environment
Learn how to deploy your Ruby on Rails app to a Staging Environment
Published:
-
Mail Interceptors & Observers in Rails
Rails lets you intercept and observe emails sent out by your application. This is incredibly useful for staging / preview environments and audit log trails
Published:
-
ActiveRecord Default Scopes, Unscoped, and Unscope
ActiveRecord default_scopes are incredibly useful for some features like soft delete. But sometimes we need to undo a scope, so that's where unscope comes in.
Published:
-
How to create Custom Elements with Web Components
Web Components are a great way to encapsulate Javascript logic around an element in your HTML. We'll explore how to create Custom Elements and see how Hotwire uses them for Turbo Stream actions.
Published:
-
How to use Rails Request.js
Learn how to use Rails' brand new Request.js library for making AJAX requests in your Javascript
Published:
-
Email Unsubscribe Links with ActionMailer in Rails
Ever wondered how to add the Unsubscribe link to your emails? We can do that using ActinoMailer in Rails with the List-Unsubscribe header and GlobalID
Published:
-
Custom Rails Configuration Options
Learn how Rails loads yaml configuration and how you can define your own configuration options with the Rails config object
Published:
-
Processing Emails with Attachments using ActionText and ActiveStorage
How to save emails with attachments using ActionText and ActiveStorage
Published:
-
Routing Inbound Emails with Actionmailbox
Learn how to route inbound emails with ActionMailbox in your Rails app
Published:
-
Outbound Email with Headers: In-Reply-To, References and more
Properly sending email notifications consists of a lot more than just a To and From. The In-Reply-To, References, and BCC headers are important for sending email notifications to your users.
Published:
-
Setting up Customer Support models with Hotwire
In part 1, we're going to setup our Rails application, our models, and connect Hotwire so we can dig into building ActionMailbox next.
Published:
-
Contrasting Colors with YIQ and Helper Tests in Rails
Ever wondered how to generate contrasting colors in your Rails app? It's easy using the YIQ calculation and we can test it easily with helper tests.
Published:
-
Multiple Device support with Request Variants in Rails
Request Variants in Rails allow you to render different HTML depending on the device defined in the User Agent header.
Published:
-
How to use Stripe Checkout in Rails
Learn how to accept payments in your Rails app with Stripe Checkout using the Pay gem
Published:
-
Wrapping Exceptions in Ruby
Sometimes you may need to wrap and reraise an exception. Ruby 2.1+ makes this easy by letting us raise a new error, pass in the old one, and automatically assigns the exceptions "cause" which is the original exception.
Published:
-
Docker Basics for Rails
Docker allows you to build a self-contained image with your application code and all it's dependencies. We'll setup our Dockerfile for the Rails app and Docker Compose yml for any other services we might need like Postgres or Redis.
Published: