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.
Ruby on Rails - improve your presence validation on the database level
Usually, when we want to ensure that value for a given column will be always present we would use the presence validator - it’s not enough. You should also validate it on the database level. Learn how
Reduce Rails build time from over 2 hours to 13 minutes
This post is written by a senior par8o engineer about how they reduced build time from over 2 hours to 13 minutes with Semaphore Boosters, fully automated parallel CI for Rails. Read it here
How Fast is Ruby 2.5.0?
Appfolio wrote a blog post as a followup on a previous article on the speed of Ruby 2.5.0, check it out here.
RSpec - make your specs beautiful, extract common test functionality
Since tests are just code, we can refactor it the same way we refactor our application classes. Many times we would need the same piece of code in the different tests so it would be nice to not repeat it over and over again. I want to make my specs beautiful
StimulusJS review
Review and opinion piece on StimulusJS. http://tomkadwill.com/2018/02/06/stimulus-js.html
Microservice Boundaries: 5 characteristics to guide your design
Are your Ruby microservices too small? Too tightly coupled? This design guide can help.
RSpec - by using let and before block you are doing it wrong
Not without a reason before and let blocks were created by RSpec authors but it’s better to avoid them when we don’t really need to use them. I want to know the right way
What Ruby Taught Me?
I’m working with Ruby for 4 weeks now. This is what this language taught me as a developer. [more inside]
A Safer Rails Console
Rails console is great to have in your toolkit, but its power can amplify the effects of mistakes. We discuss strategies for making it safer and built a gem around that. https://www.salsify.com/blog/engineering/a-safer-rails-console
[Screencast] Ruby on Rails - Tips and Tricks
In this episode, we will go through some of the tips and tricks that we often take for granted. We will be looking at nested routes, scopes, migrations and more. https://www.driftingruby.com/episodes/ruby-on-rails-tips-and-tricks
Optimize Rails performance bottleneck with caching and Rack middleware
A tutorial about Ruby on Rails optimization technique which resulted in over 500% performance improvement. Covers basic caching with Redis and custom Rack middleware setup. [more inside]
RSpec - create your own custom matcher
RSpec built-in matchers are great but sometimes they are not enough. Fortunately, we can create easily our own matchers. Of course, we can then reuse them across the whole application - I want to level up my RSpec game
Hello Stimulus on Rails
A pull request to get you started with Stimulus on Rails via webpacker [more inside]
Views in Ruby on Rails – advanced usage of content_tag helper
Generally, there are two common ways of creating HTML code in your Ruby on Rails app views: you can simply write HTML code or generate it by using helpers from ActionView module. LEARN MORE
Stimulus with Turbolinks, select2 and FormValidation in Rails
A short before and after example of conversion into using Stimulus [more inside]
Ruby on Rails refactoring - service object pattern
This refactoring pattern is very simple but I found it very useful in every app I was working on. You can use it wherever class or method has to much code. Learn about this pattern