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...
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...
This is a bookmarklet you can add to Chrome or Firefox which will allow you to create a story in...
sudo gem install gettext --no-ri --no-rdoc sudo gem install fast_gettext --no-ri --no-rdoc script/plugin install git://...
After updating Rubygems you see a wall of deprecation warnings like this: NOTE: Gem::SourceIndex#add_spec is deprecated, use...
Within Capybara you most certainly use the #check- and #uncheck-method to (un)check checkboxes. But there's one problem...
RubyMine offers you to exclude directories from search, meaning faster search results and less "noise" in the list of result...
Sometimes, the rails dev server doesn't terminate properly. This can for example happen when the dev server runs in...
The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...
ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...
When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...
Carrierwave includes some handy helper methods you can use to resize your images. Here is a quick summary of them...
After upgrading to Rails 6.1.7.2 one of our apps printed a wall of warnings while booting: /var/www/app/shared/bundle/ruby/2.6.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: already...
# Capitalized expressions are intended to be replaced with YOUR values describe 'SERVICE', -> beforeEach -> module 'MODULE' module ($urlRouterProvider) -> # Prevent uiRouter's initialization, i.e. do not sync the current URL...
When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...
Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")
...iterated until the final design is ready – shiny, accepted and ready for implementation. I believe this works well when you get to work with the final decider in person.
We forked trusty memoizer to make two changes: Memoized methods now preserve their arity. Previously all memoized methods had an...
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...