Within Capybara you most certainly use the #check- and #uncheck-method to (un)check checkboxes. But there's one problem...

Sometimes, the rails dev server doesn't terminate properly. This can for example happen when the dev server runs in...

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...

When you use the send_file method to send a local file to the browser, you can save resources on...

...to a value. The validation is skipped silently when terms is nil. While this behavior is useful to validate acceptance in the frontend and not the admin backend, it also...

The cards editor has a feature "Cite other card" to create links to other cards in the same deck as...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one...

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...

Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")

Yesterday, Rails fixed a security issue (CVE-2014-3514) in Rails 4+. It was possible to use .where...

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...

We forked trusty memoizer to make two changes: Memoized methods now preserve their arity. Previously all memoized methods had an...

...new RegExp('^(\\d+) users') # => /^(\d+) users/ Our expression above now works only at the beginning of the matched string, looks for a number (\d+ [1]) and also captures that. Sweet...

...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.

...might have a negative impact on your application's performance. We did not yet benchmark it, but using it for elements that are rendered very often is probably a bad...

In order to request a SSL certificate from any dealer, you usually need a CSR certificate. As both the CSR...

github.com

The ancestry gem allows you to easily use tree structures in your Rails application. There is one somewhat unobvious pitfall...

By default, Devise redirects to a sign-in form when accessing a route that requires authentication. If for some reason...

...nested, :inverse_of => :parent accepts_nested_attributes_for :nested end class Nested < ActiveRecord::Base belongs_to :parent validates_presence_of :parent_id # <- end With the parent already persisted creating nesteds...

...soften the validation to only validate on the associated object: class Nested < ActiveRecord::Base belongs_to :parent validates_presence_of :parent # <- without `_id` end Drawback With this softened validation now...

...switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function I can...

...export_path = Dir.mktmpdir('exports') # ... ensure FileUtils.remove_entry(export_path) end Option 3: Using a before/after block before { @export_path = Dir.mktmpdir('exports') } after do if @export_path.present? FileUtils.remove_entry(@export_path)

angular-tips.com

Angular comes with different types of services. Each one with its own use cases. All of these services are singletons...

When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...

...origin (e.g. git fetch and git status). You should be 0 commits ahead or behind. Add and commit a file touch .please-update git add .please-update

...is no way to make GitHub do this nicely. :( If you know of a better approach, please let me know...