IRB 1.2 (shipped with Ruby 2.7, but works on 2.5+) brings pretty syntax highlighting and multiline cursor navigation. However, pasting...
Bundler allows you to specify the name of the Gemfile you want to bundle with the BUNDLE_GEMFILE environment variable...
A lesser known fact about PG enums is that they are ordered. This can be really handy when values have...
Rails 5.2 soft-deprecated the storage of secrets in secrets.yml in favor of a new thing, credentials.yml.enc. Rails 7.1 deprecated...
...It's much easier to detect the current Rails environment instead. You might be better of checking against the name of the current Rails environment. To do this, store the...
You can use local copies of gems in your Gemfile like this: gem 'spreewald', path: '~/gems/spreewald' As soon as you...
Timecop is a great gem to set the current time in tests. However, it is easy to introduce flakyness to...
...the joins, and then authors for the pluck clause. The first corresponds to the belongs_to relationship, and the latter is the name of the db table. You could even...
...between added? and of_kind? While added? might feel more natural to use, it behaves differently than of_kind? because it also compares options from the validation error. of_kind...
The Node Version Manager allows installing multiple NodeJS versions and switching between them. By default, it does not automatically switch...
If you ever need to restore exact records from one database to another, Marshal might come in handy. Marshal.dump is...
Besides Plotting graphs in Ruby with Gruff, which comes handy for many uses cases, you sometimes might need configuration for more advanced plots, e.g. for academic concerns. Then using Gnuplot...
...where each array holds the data for x-, y- or z-axis. The major benefit of numo-gnuplot is that it supports advanced numpy like array operations, like multi array...
The robots.txt file and HTML tag can be used to control the behavior of search engine crawlers. Both have different effects. robots.txt Marking a URL path as "disallowed" in robots.txt...
The linked MDN article is quite informative of a neat feature supported by all major browsers: Unicode character class escape...
When changing code in mailers, updating the corresponding mailer preview can be forgotten very easily. Mailer previews can be tested...
...Middleman brings Haml, Sass, helpers etc. However, it can be configured to do even better. This card is a list of improvement hints for a Rails developer. Gemfile
...helpers in a helpers {...
...} block. However, this does not scale very well. You're best off creating a /helpers directory and putting helper files there just like you know it...
If the project team consists of at least 2 members, do a daily standup. It should not take much longer...
...Rails has a method ActiveRecord::Relation#merge that can merge ActiveRecord scopes. However, its behavior has never been clear, and in Rails 7 it still discards conditions on the same...
...column by the last condition. We discourage using #merge!) The best way to merge ActiveRecord scopes is using a subquery: scope_a.where(id: scope_b) It is a little less concise...
SimpleForm is a great approach to simplifying your forms, and it comes with lots of well-defined input types. However...
RSpec 3 has verifying doubles. This breed of mock objects check that any methods being stubbed are present on an...
...follow redirects to get the desired response. This is supported but not the default behavior. You can do so by using the .follow method. This follows redirects for the following...
There is a common view that extracting text from a PDF document should not be too difficult. After all, the...
When you are using lambdas in RSpec to assert certain changes of a call, you know this syntax: expect { playlist.destroy...
When giving a presentation where you do some coding, the font size you usually use is probably a bit too...