Let's say you want to find the element with the text hello in the following DOM tree: hello
TL;DR There are three dimensions you can control when scoping routes: path helpers, URL segments, and controller/view module.
Uses FFI and works all relevant operating systems. If you'd try to do it yourself, you'd have to...
Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...
RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created...
Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...
If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...
Angular's directives have a transclude option, that allows for rendering an element's original content within the directive's...
A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...
To install gems Bundler needs to be able to talk to https://api.rubygems.org. If you are behind a proxy you...
During debugging you might pepper your code with lines like these: console.log('foo = ' + foo + ', bar = ' + bar) I recommend to use...
From Rails 3.0.9, there is a method Hash#to_query that will turn a Hash into a query string:
I got this error when running Rails 2.3 tests for Rails LTS. More stacktrace: NoMethodError: undefined method `cache' for Gem...
Using Scenic, you can bring the power of SQL views to your Rails application without having to switch your schema...
Note Maintenance mode is enabled on application server as soon as the file /public/system/maintenance.html is present. Note that the servers...
You login to a Linux server with a performance issue: what do you check in the first minute? uptime
Once Rails knows a given string is html_safe, it will never escape it. However, there may be times when...
PostgreSQL offers a really handy field type: json. You can store any JSON there, in any structure. While its flexibility...
rack-mini-profiler is a powerful Swiss army knife for Rack app performance. Measure SQL queries, memory allocation and CPU...
There are cases when you need to select DOM elements without jQuery, such as: when jQuery is not available
In Ruby 2.3 you can use <<~ instead of <<- to automatically remove indentation from a HEREDOCs: str = <<~MESSAGE Hello Universe!
The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...
CSS4 comes with :has. E.g. h1:has(b) would select all tags that contain a tag. This is implemented in...
E-mails are usually encoded using Quoted Printable. Here is how to decode or encode such strings. You probably know...