If you migrate a Rails application from Sprockets to Webpack(er), you can either transpile your CoffeeScript files to JavaScript...
In Ruby you can communicate between processes with sockets. This might be helpful in tests that validate parallel executions or...
If you use transactional_fixtures or the database_cleaner gem with strategy :transaction, after_commit callbacks will not be fired...
...polymorphic association. class Event < ApplicationRecord has_many :letters, as: :record end class Letter < ApplicationRecord belongs_to :record, polymorphic: true end event = Event.new.letters.build event.save! # => ActiveRecord::RecordInvalid: Validation failed: Record must exist...
...member', :home_page end It has some limitations: Only works for singular member references ("belongs to"), not for a collection of references ("has many") No support for deletion (but could...
With cd .. you can navigate one directory up from the one you are at now. If you use that a...
...when you run a Selenium test with Capybara. This will help you understand "impossible" behavior of your tests. When you run a Rack::Test (non-Javascript) test with Capybara, there...
...you. But sometimes the complexity will bleed through, causing your tests to show "impossible" behavior. Here is some unexpected behavior caused by the interaction of threads and processes:
Zeitwerk is the new autoloader of Rails. It is mandatory starting with Rails 7.0. Sometimes, a model needs to know...
...skipping asset compilation when assets have not changed? Turns out there is an even better way to speed up Capistrano deployments with asset compilation – and it's even simpler.
Capybara added a deprecation warning in version 3.35.3 (version from 2019) that shows up if your selector is not of...
We had a strange behaviour on one of our mariadb-servers: Everyday at around midnight we saw that the root-account on one of our servers is trying to access...
Controllers Take care when defining nested resources, as they don't behave identical to namespaced resources: namespace :users do resources :sign_ups, only: [:new] end # GET /users/sign_ups/new...
...in controllers/sign_ups_controller.rb in order to make the second example work. You can alter this behaviour with a custom controller path, as shown in the very first example of this card...
Unpoly's [up-observe], [up-autosubmit] and [up-validate] as well as their programmatic variants up.observe() and up.autosubmit...
When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...
When storing files for lots of records in the server's file system, Carrierwave's default store_dir approach may...
This should not be necessary in any case and is only for special cases, for e.g. if the assets...
accepts_nested_attributes_for :children validates_associated :children end class Child < ApplicationRecord belongs_to :parent, inverse_of: :children end class Child::AsForm < ActiveType::Record[Child] change_association :parent...
...AsForm record with nested Child::AsForm records, the children will not be saved. This behavior also applies to the case where you override the association with has_many :children,...
...and...
If you are using scrum in a project you might be familiar with planning poker, a playful way to agree...
By default, Devise redirects to a sign-in form when accessing a route that requires authentication. If for some reason...
sudo gem install gettext --no-ri --no-rdoc sudo gem install fast_gettext --no-ri --no-rdoc script/plugin install git://...
This is a bookmarklet you can add to Chrome or Firefox which will allow you to create a story in...
Du verstehst was eine Custom Resource ist und warum das nützlich sein kann. Du weißt, was ein Operator ist...
After updating Rubygems you see a wall of deprecation warnings like this: NOTE: Gem::SourceIndex#add_spec is deprecated, use...
collectd5 in version 5.9.0 is broken and you upgraded it everywhere. But because it's FreeBSD it does not...