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.
Spree Commerce 3.7 with new REST API v2 released!
Completely new REST API v2 powered by Netflix fast_jsonapi gem, API documentation in OpenAPI (Swagger) with Postman import support, Service Oriented Architecture - those are only the highlights of this huge release. [more inside]
The Enumerable module in #Ruby: Part I
As Ruby is a fully object-oriented programming language, even traversing a collection can be accomplished directly through the collection itself.. SEE MORE
sruby - Simple, Secure & Solid Ruby (for Blockchain Contract Scripts)
Hello, I’ve published a new red paper that introduces the new sruby version / flavor. sruby - short for simple, secure & solid ruby - is a subset of mruby that is a subset of “classic” ruby and lets you run contract / transaction scripts on the blockchain / world computer. Happy transacting with sruby. Cheers. Prost.
[Screencast] What the RegEx?
In this episode, we look at different ways to use pattern matching with Regular Expressions in Ruby. https://www.driftingruby.com/episodes/what-the-regex
How to handle layout changes when using HTTP caching in Rails
It is very easy to get started with HTTP caching in Rails, but there are a few small things you need to watch out for. Handling layout changes is one of those things, and I explain how to do that in this article.
Universum - next gen world computer runtime - run contracts in ruby
Hello, I’ve updated Universum - a next generation ethereum-like world computer runtime - that lets you run contract scripts / transactions in ruby on the blockchain. Cheers. Prost. PS: See the Programming Crypto Contracts Step-by-Step guide / book for more contract samples in ruby (e.g. satoshi_dice.rb, ponzi_governmental.rb and many more).
Using the Find module to count the LOC of a Rails application
In this article, we’re going to describe the Find module and use it for counting the Lines of Code of a Rails application.. SEE MORE
Rails Isn’t Dead, Not Even Close. 6 Rails Advantages Keeping It Alive
Why should you be using Ruby on Rails for e-commerce? Answers inside that piece, complete with a shop tutorial on top of Refinery CMS. Code snippets, repo, and demo included! [more inside]
Programming Crypto Contracts w/ Ruby - New Chapter: Ponzi Governmental - Win Jackpot!
Hello, I’ve added a new chapter to the (free online) step-by-step guide / booklet titled “Programming Crypto Blockchain Contracts (with Ruby) Step-by-Step Book / Guide”. Let’s look at the p@nzi governmental - a real world case study - last creditor / investor (before collapse) wins the jackpot! Cheers. Prost.
Rails handles large number of nested routes better than Sinatra
I ran Jeremy Evans routing benchmark and here are the numbers.
Rails includes vs Join
When I started learning Rails, I was always in a state of confusion about using includes or joins, because both are used in almost same scenario. Includes uses eager loading whereas joins uses lazy loading. Both are used when certain operations are meant to be performed on associated tables. And here comes the difference. https://medium.com/@swapnilggourshete/rails-includes-vs-joins-9bf3a8ada00
RSpec Mocks and Stubs in Plain English
One of the most common questions I see from beginners to Rails testing is what mocks and stubs are and when to use them. https://www.codewithjason.com/rspec-mocks-stubs-plain-english/ If you’re confused about mocks and stubs, you’re not alone. In my experience very few people understand them. In this post I’ll attempt to help clarify the matter, particularly in the context of Rails/RSpec. [more inside]
Hanami v2.0.0.alpha1
First preview of the 2.0 series. App simplification, new router, rewritten actions, fresh code reloading strategy. http://hanamirb.org/blog/2019/01/30/announcing-hanami-200alpha1.html
validates number of attached files (for active storage)
https://github.com/igorkasyanchuk/active_storage_validations new version of gem now supports min/max number of uploaded files. thanks to @ivanelrey
“!” and “?”: Understanding One of Ruby’s Coolest Naming Conventions
“Guys, are the ! and ? that we find at the end of method names a convention of Ruby, RoR, or whom else?” [more inside]
Hosting microservice SPAs on Azure Storage Account blobs proxied by Nginx [prototype]
As you may know simmilar to AWS S3, with Azure Storage Account blobs you can host static website on these service. (so you pay few cent per month hosting) [more inside]
ValueSemantics—A Gem for Making Value Classes
ValueSemantics is a gem for making value classes, with attribute defaults, validation, and coercion. This article also covers some of its design considerations, such as using exceptions to catch developer mistakes, extensibility, being unobtrusive, integration continuity, stability, thin DSLs, and “no setters” immutability.
Rails Routes, HTTP Methods and SQL Queries
One of the most important things to learn when trying to understand Rails is how HTTP Methods work with Rails Routes and SQL Queries. In this post we go in-depth to explain how they all work to gather
Maily v0.9.0 - external mailers support
A new version of Maily (https://github.com/markets/maily) v0.9.0 has been published 🚀. Mainly, includes a new feature to simplify integration with emails from other gems. Example, with Devise:
Requiring a file or library in Ruby
In this article we’re going to explore the following topics:
How to Tell the Difference Between a Default and a Provided Value for Optional Argume
It is sometimes required for the methods with optional arguments to be able to differentiate between its default value and the value passed from the caller. Passing nil might initially sound like a good idea since it represents “nothingness”. However, it might turn out that nil is a legit value and there might be cases where it is desirable for the caller to pass nil. In such a case, we cannot use it as a default value if we want to implement a special logic for the case of not providing that value. [more inside]
Not-so-private constants in Ruby
Sometimes intuition cheats us. That was a case for me with defining private constants in Ruby. Putting them within private block is not enough to achieve the desired effect. https://frontdeveloper.pl/2019/01/not-so-private-constants-in-ruby/?utm_source=rubyflow.com
Playing with Ruby object model: prototypal inheritance
The article shows how to implement something resembling prototypal inheritance. While the end result shouldn’t be used in production, I think it’s an excellent opportunity to learn or systematize certain concepts of the Ruby object model. [more inside]