News
Modeling your public static pages as resources in Ruby on Rails
So, a very simple example would be for you to have a resource :privacy_policy, only [:show]. The icky thing with that is that while you are suggesting a single resource here, Rails controllers are not smart enough to acknowledge it, so you'd still...
Examples to explore possible race conditions when caching custom computed values in Rails
In Rails, sometimes you will need to save counts or custom computed values, where the default counter cache will not be enough.Maybe you want to…Update a counter cache when a value change and not only when the association is created or deleted.Hav...
Social Login in Rails with Rodauth | Janko's Blog
OmniAuth provides a standardized interface for authenticating with various external providers. Once the user authenticates with the provider, it’s up to us developers to handle the callback and implement actual login and registration into the app....
Easy to Miss Way to Optimize ActiveRecord SQL Memory Usage in Rails
Active Record empowers developers to write fairly complex database queries without understanding the underlying SQL. Unfortunately, the same ActiveRecord is a reason for the majority of the issues that I encounter while conducting my Rails perform...
8 Design Principles that every Ruby Developer should know
In this article we'll discuss 8 design principles that every Ruby developer should know. We'll go through each principle, giving a definition, a simple example, and the benefits they give us.So, what are they?DRYKISSYAGNISOLIDSingle-responsibility...