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.
Using reCAPTCHA v3 with Turbolinks
reCAPTCHA v3 will stop working after a Turbolinks navigation. This implementation works by using the API’s explicit render (for the badge) and data-turbolinks-permanent to keep it on navigation. read more
3 Unexpected Behaviors using Ruby
READ THE POST — In Ruby, what I call an unexpected behavior is a behavior that doesn’t seem natural at first. [more inside]
What makes a great software engineer, great
Today I woke up wanting to start a discussion about what it takes to be an awesome software engineer. I constantly see recruiters evaluating candidates solely based on their programming skills. Hence, most developers focus only on learning the latest programming language out there. Is that all it takes? Here’s my two cents on the matter. [more inside]
RFS: Attr Reader, Writer and Accessor [free video]
In ruby a lot can be achieved in a single line of code. Defining our own getters and setters is usually done when we need custom behavior for all other cases there is already something built in ruby. We’ll cover attr_reader, attr_writer and attr_accessor in this post.
Tracking Email Open in Rails
How do you know if the email you sent was opened or not? A simple solution on Tracking Email Open in Rails
Exporting and Importing large amount of data in Rails
In this TIL note I will show you few ways how to export / import large quantity of data between two applications (e.g. old version to new version of the app) [more inside]
Fail Better: Turning Software Errors into Documentation
The open-source community has done a great job of promoting good documentation as a necessary trait for the success of a software project, whether it be a utility library, a larger framework or a standalone program. In my latest article I explain how we can take it one step further and also use error messages to educate our users.
Invalidating caches when using many-to-many associations in Rails
Implementing various methods of caching in Rails is relatively simple, and in most basic cases Rails handles cache invalidation out of the box or with minimal code. But when using many-to-many associations, propagating changes in one object to all its associated objects needs some setting up so that Rails can handle cache invalidation. In “Invalidating caches when using many-to-many associations in Rails,” I talk about various methods of achieving this, and why one should choose one over the other.
Run.rb (Ruby 2.6 compiled to WebAssembly)
My friend Will Glynn and I worked on a project recently that allows you to type out and execute Ruby code without ever leaving the browser. It’s Ruby 2.6.0 compiled to WebAssembly! We call it run.rb and pronounce it “runner bee.” Our next goal is to add the standard library to the website. Please give it a spin and let us know what you think! I wrote up a quick explanation of why I wanted to build it here. I’d love any ideas of how we can make it better. ❤️
Testing Rake tasks.
Some developers argue on the real value of testing Rake tasks since they’re only used once or on rare particular occasions. Others think it’s enough to extract all the logic out of them to properly tested objects (we’ll look into that later). Before fully diving into the question of how to test them (and if it’s really worth it), we’ll take a quick look at Rake tasks themselves. [more inside]
LIT Rails Internationalization (i18n) - the new way of translating Rails apps
Introducing - Lit 1.0: A reworked i18n Ruby gem that will make your web app’s translation a lot easier. https://prograils.com/posts/lit-rails-internationalization-i18n-new-way-of-translating-rails-apps
Ruby on Rails 6.0 Beta 1 Deprecations
A list of the deprecations that are listed in the CHANGELOG.md of the Ruby on Rails 6.0Beta1 release. https://blog.driftingruby.com/ruby-on-rails-6-0-beta-1-deprecations/
kramdown 2.0.0 released
I just released kramdown version 2.0.0, see https://kramdown.gettalong.org/news.html for details. Most notable changes: Ruby 2.3 required and several extension were extracted.
What's new in Ruby 2.6
A quick summary of the new features in Ruby 2.6: http://nithinbekal.com/posts/ruby-2-6/
Adopting GraphQL and Transitioning to Domain-Driven Services
An overview of how Handshake is adopting GraphQL while breaking apart its Rails monolith to a set of smaller applications focused on serving specific user types. https://medium.com/rubber-ducking/adopting-graphql-and-transitioning-to-domain-driven-services-ea51309f95f7
Video Tutorial: Unpacking a Vue.js and Rails app
What does it take to put together a modern single-page web app using Vue.js on the frontend and Rails as the backend API? The Pragmatic Studio unpacks the design, architecture, and implementation of a full-stack application so you understand how everything works together. No need to get bogged down in figuring out how to put all the pieces together yourself. https://pragmaticstudio.com/courses/unpacked-single-page-app-with-vue-rails
Easy Local SSL for Rails Development
There are plenty of options out there for a more robust solution for local SSL testing and development, but this has served me well for a quick way to get SSL requests routed back to my app. https://github.com/rickpeyton/localhost_nginx_ssl
Ruby Quiz - Challenge #11 - Blockchain Contracts - Disassemble Ethereum Bytecodes
It’s Friday. Ruby Quiz time! Join us. Let’s keep going with a new Ruby Quiz every fortnight. Ruby Quiz - Challenge #11 - Blockchain Contracts - Disassemble & Assemble Ethereum Virtual Machine (EVM) Opcodes / Bytecodes. Send your code snippets (or questions & comments) to ruby-talk. Happy opscode hacking and blockchain contract bytecode assembling & disassembling with ruby.
Dynamic ActiveRecord columns
https://engineering.culturehq.com/posts/2019-01-18-dynamic-activerecord-columns In this post we discuss ways to reduce the amount of data you’re selecting from the database by using dynamic column names
Ever Wondered About Rails Application Templates?
Ever wondered that you run usual rails new my_awesome_app and you get a really fully bootstraped, authentication added, administration added and lot more for you to just start focusing on business logic instead? THIS WRITE UP IS JUST ABOUT THAT… https://deadsimpleror.wordpress.com/2018/11/27/rails-application-templates/?preview=true
The autoload Method in Ruby
LINK – The Module#autoload method registers a file path to be loaded the first time that a specified module or class is accessed in the namespace of the calling module or class..
Postgres Arrays vs JSON data types in Rails 5
Which postgres complex data types should be used for what? [Postgres Arrays vs JSON data types in Rails 5]