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.
How to download images files in Ruby
The easiest way to download an image or file in Ruby is using open-uri. This post looks at how to do that, what the potential problems are and how to do it better. This is my view on how to download images in Ruby.
Contract Scripting for Everyone: Hyperledger FabCar Chaincode Sample in (Secure) Ruby
Hello, for the Vienna Hyperledger Meetup I’ve put together a talk titled “Contract Scripting for Everyone: (Hyperledger) FabCar Registration Sample - From Go Lang Chaincode to (Secure) Ruby Contract Scripts” that shows that - surprise, surprise - (secure) ruby works great for (contract) scripting. Code is code and Hyperledger Fabric is really just a key-value store, that is, a simple hash table. Yes, we are still waiting for the SQL (relational) revolution in the blockchain world. PS: Bonus slides - Do you need a blockchain? TL;DR Version - No.
Rails 6: B-Sides and Rarities
Rails 6 contributor and early adopter Vladimir Dementyev walks you through the B-sides and rarities of the upcoming release, focusing on smaller features that appeal to mature applications.
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.