The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Submit a post
Post Preview
Note: Only the first pargraph is shown on the front page and overly long paragraphs may be broken up.
Implementing authentication with Auth0 and Rails 6
Rails 6 + Auth0 for authentication using Rails’ credentials, a custom reset_sesssion and a more graceful way of handling failures.
GraphQL. The Rails way
A short story how one small gem can make big difference in ruby powered GraphQL: https://medium.com/@po.jurcys/graphql-the-rails-way-bcb686192533
The RSpec Style Guide: Reloaded
Recently I wrote a short article on some recent efforts to revitalize the work on documenting and promoting best RSpec practices.
How you can dual boot your application to get ready for Rails 6
This article explains how you can dual boot your application in your local environment and your CI server to help you get ready for the next stable release of Rails. [more inside]
4 amazing features of Ruby on Rails 6.0
The release of the newest version of Ruby on Rails is just around the corner. With it, a ton of new features will be introduced to the public. We’re excited to see all the new stuff Ruby on Rails 6.0 has to offer! With regular releases of the beta versions, developers had access to the upcoming framework for quite a while and they reported that it looks solid. Will the new Ruby on Rails 6.0 bring back the enormous popularity RoR once had? [more inside]
Use pessimistic locking to make long running tasks in Rails free of race conditions
Rails has you covered in situations like this but you should still be a bit careful :) [more inside]
Remove Unused CSS Classes from Tailwind CSS, Boostrap, and more with PurgeCSS
CSS frameworks like Tailwind, Bootstrap, Foundation, etc all come with many CSS classes you probably aren’t using. This creates huge CSS files unless we use a tool like PurgeCSS with Webpack to look through our code and remove the unused classes. Learn How to Use PurgeCSS with Rails
Moderate Parameters: The Path From Protected Attributes to Strong Parameters
We all know Strong Parameters isn’t exactly cutting edge technology. But with many apps still using Protected Attributes, we built a tool to bridge the gap. We call it Moderate Parameters.
Deploying serverless web apps to Google Cloud Run
Google Cloud Run is a new serverless platform that runs Docker containers as web services. Here’s a tutorial on deploying a Sinatra web app — it feels as easy as Heroku.
Graphiti: Stylish Graph APIs
Graphiti makes RESTful Resources a first-class concept. This enables reading and writing a graph of data in a single request, a schema with backwards-compatible gaurantee, end-to-end integration test patterns, seamless microservices and much more. A stylish alternative to GraphQL. [more inside]
Active Storage meets GraphQL: Exposing attachment URLs
The second post in “Active Storage meets GraphQL” series describing how to deal with N+1 problem, variants generation and code reusability when exposing attachment URLs in GraphQL schema.
Build your own decorator - 3 times faster than Draper, 60% fewer objects allocated
Using Draper gem for simple decoration in your Rails application? You can easily build your own solution which will be a better fit. READ MORE
Awesome Types & Type Signatures / Annotations for Ruby
Hello, I’ve started to put together a new awesome page collection about all things types, type signatures / annotations and more for ruby - incl. bool, bytes, buffer, enum, flag, record, data and more. Is static the new dynamic? Happy coding with ruby with types.
Rails 6 allows to override the ActiveModel::Errors#full_message format
Rails 6 allows to override the ActiveModel::Errors#full_message format at the model level and at the attribute level - https://blog.bigbinary.com/2019/04/22/rails-6-allows-to-override-the-activemodel-errors-full_message-format-at-the-model-level-and-at-the-attribute-level.html
FactoryBot Tips
FactoryBot Tips article to provide a few guidelines I think about when creating factories to avoid test data from becoming messy and fragile.
Types & Type Signatures (for Ruby) Incl. Bool, Enums, Flags, Records, and More
Hello, I’ve started a new org that collects types and type signatures (typesigs) for ruby including Bool, Enum / Flag, Record, Data, and more. Note: Most gems / libraries are zero-dependency and, thus, can get used on its own / standalone. Happy coding with ruby (with more types). PS: Yes, the gem / libraries moved from the (secure) ruby org.
rspec-benchmark adds objects and memory expectation
The latest rspec-benchmark adds a flexible expectation for testing objects and memory usage. It also adds the ability to configure global options such as the number of samples for perform_under and computational complexity matchers. Happy safe hacking!
Use Event emitter in Ruby
Just an article about using Event emitter and how to implement it. [more inside]
‘Cody the game’… A story of the special game for Ruby programmers
One day 3 years ago in the Codest team we prepared a great Cody game for Ruby programmers. In today’s article, I would like to describe what the work on this project looked like and above all show you the code of the project, which from now on is publicly available on our github. Read more: https://codesthq.com/blog/cody-the-game-a-story-of-the-special-game/