Pattern Matching is finally coming to
Ruby in version
2.7, and I’m very excited for it to be one more tool in the toolbelt of us Rubyists.
You might or might not already know what
Pattern Matching is; either way, this post is meant to give a very simple crash-course or go-to reference.
Pattern matching consists of specifying patterns to which some data should conform and then checking to see if it does and deconstructing the data according to those patterns — Learn You a Haskell for Great Good! (Miran Lipovaca)
YAML files are the number one place to define translations with
I18n. But, did you know that
ruby (rb) files can be another option? Even a more powerful one…
I found out about this while working on a project that uses it, and when I tried to find more about it online I realized it was not a straightforward thing to search for. I hope that with this post, developers can find this more easily and leverage it sooner in their codebase if needed. Please note that this post is based on
i18n v1.6.0–I didn’t try earlier versions.
Is this error giving you a headache? Have you already tried using
and return as Rails suggests in its guides but still can’t make the error go away?
TL;DR: See if you are calling
render in controller concerns. This post will explain why this might be the issue that’s right under your nose.
The key thing to understand here is that
render has multiple implementations in Rails and we need to know which one is being used when.
# rails/actionview/lib/action_view/renderer/renderer.rb# Main render entry point shared by Action View and Action Controller.def render(context, options)
if options.key?(:partial) …
Let me share with you a quick life principle I keep convincing myself of: “It’s never too late to reinvent ourselves.” Cheesy, isn’t it? Maybe… but it’s a principle that has helped me and my partners restructure our work life.
For more than 8 years I’ve been either an employee or co-founder of software development companies and I don’t remember ever feeling comfortable with the open-source contribution approach. Not because open-source was a neglected effort, but because it was not ideally prioritized.
Am I responsible for it? Definitely. I tried doing something about it, but I should have pushed harder…
Have you ever felt that you are not working hard enough to share your work with the world? It doesn’t matter if we are talking about small achievements or masterpieces; the world is filled with problems to be solved, and we need to minimize the time people spend reinventing the wheel.
This blog is for the tech community. I’m not going to lie… we are also fulfilling our needs to write and share — yes! — , but that’s not the main goal of this blog. …
Co-founder & Software Engineer at @cedarcode