Systems | Development | Analytics | API | Testing

Ruby

How to Handle the Unpermitted Parameters Error in Ruby

The ActionController::UnpermittedParameters error occurs when a parameter that has been passed is not permitted in a create, an update, or a user-defined action. In older versions of Rails, information about the unpermitted keys was provided in the logs only when an unpermitted parameter was found in a request. This did not provide enough information for the developers to understand which controller and action received the unpermitted parameters.

How to Parse Arguments in Your Ruby C Extension

Ruby is a wonderful language, made for humans first and machines second. It is easy to read and write. There are plenty of ways to write anything, and you can often guess its standard library by typing the name of the method you would have chosen yourself. Because of this, Ruby's arguments are very flexible, which lets us express our APIs very clearly. But this comes with a drawback: Ruby is quite hard to parse for C extension developers!

A First Look at Hanami 2 for Ruby

As of today (06/12/2022), Hanami 2.0.1 has been released. Read more about the enhancements, bug fixes and gems in release 2.0.1. Hanami 2 was released on 22 November, concluding four years of work on this version. It brings a breath of fresh air into Ruby's web development community. Version 2.0 is not just an incremental upgrade. One could say it's a project written anew, with bright ideas from version one rebuilt on top of a solid dry-rb libraries ecosystem.

How to Resolve NameError: Uninitialized Constant in Ruby

A NameError is raised when a referenced variable or a constant, such as a module, a class, or a constant variable, isn't defined or is invalid. The Uninitialized Constant error is a variation of the NameError exception class and has several reasons to occur. When this error occurs, several class names appear in place of Something.

Improve Code in Your Ruby Application with RubyCritic

RubyCritic provides visual reports highlighting code smells, code structure, ease of testing, and test coverage in your Ruby application. It's in active development, with new code analysis tools often being introduced as new features. It's well worth keeping track of RubyCritic's releases. This article will touch on some of RubyCritic's benefits, its dependencies, and how to read its code reports. Let's get going!

Debugging in Ruby with AppSignal

An application monitoring tool (APM) is not just useful for seeing how your application performs through graphs and visuals. We can go deeper and use an APM to understand how your application behaves in a certain environment. As developers, we should aim to be less reactive to errors and more predictive, avoiding crashes for end-users. One way to accomplish this is by using monitoring tools to debug our application when an error occurs.

JIT Compilers for Ruby and Rails: An Overview

A program is compiled at runtime using a different method from pre-execution compilation. This process is known as just-in-time compilation or dynamic translation. In this post, we'll look at why JIT compilation can be a good choice for your Ruby on Rails app, before looking at some of the options available (YJIT, MJIT, and TenderJIT) and how to install them. But first: how does JIT compilation work?