...ES5. This means that examples for transpiled results or the "Try CoffeeScript" web console behave differently, and lookup up stuff when working on older projects may be somewhat hard.

...to when precompiling your assets, and give your stylesheets access to all the regular bells and whistles (like asset_path, proper @imports etc): class DynamicStylesheetsController < ApplicationController def show logical_path...

Rails comes with a Rake task notes that shows code comments that start with "TODO", "FIXME", or "OPTIMIZE".

...the first time it was referred to, causing user to be loaded, which Ruby believed it had not seen before. And that caused a completely different spec to fail at...

There seems to be no built-in matcher in RSpec to check if a string contains terms in the desired...

...its internal state. It is usually sufficient to use the then() function. Where promiseState() becomes useful is when writing unit tests for a function that returns a promise.

tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...

Like you know from "How to tell ActiveRecord how to preload associations (either JOINs or separate queries)", you can tell...

On application servers, gems are usually bundled into the project directory, at a location shared across deployments. This is usually...

...supports standard Hash.new forms There's also a Concurrent::Cache class that sort of behaves like an unordered Hash, but is much faster. Info If you're using Rails you...

a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as -M5...

makandra dev
innig.net

If you want to get a deep understanding of how closures, blocks, procs & lambdas in Ruby work, check out the...

makandra dev

Spreewald now has a spreewald binary that lists all available steps, optionally filtering them. Example: $> spreewald # All Spreewald steps

To achieve this goal you have to setup the session store like the following example: MyApp::Application.config.session_store( :cookie_store...

...it with additional joins or conditions. We call this chaining scopes. In practice chaining becomes problematic when scope chains grow more complex. In particular having JOINs in your scope will...

...year is the week with January 4th in it. All days in this week belong to the year. This means that January 1st, 2nd and 3rd may or may not...

...the year. I am not sure which year December days in the same week belong to, I believe the week actually gets split into two calendar weeks in two different...

This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...

Rails flashes (FlashHash) track a list of used keys, which is not respected when comparing flash hashes.

makandra dev

We have projects that have been developed using many different versions of Ruby. Since we do not want to...

...use Spreewald's "... in the HTML" meta step, or add this proxy step for better semantics: Then /^I should( not)? see "(.+?)" in the page source$/ do |negate, text|

...to intercept those RSS links, and Capybara internally remains on the previous page. This behavior can be circumvented with the following simple step: # Firefox seems to intercept RSS links. Use...

makandracards.com

The step we used in the past (Then "foo" should not be visibile) doesn't reliably work in Selenium features...

When writing a Sass function, you may run into an error message that may be confusing: @function rules may not...

Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...

Unfortunately, Capybara does not offer a switch to disable cookies in your test browser. However, you can work around that...