Don't sum up columns with + in a sql-query if NULL-Values can be present. MySQL and PostgreSQL cannot...

api.rubyonrails.org

Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...

When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...

Form fields can be rendered as noneditable by setting the disabled or the readonly attribute. Be aware of the differences...

Sometimes it's necessary for you to check which ports are in use on your local machine and which process...

Understanding your type of cronjob Some cronjobs must only run on a single server. E.g. when you run nightly batch...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...

This is a small example on how you can check if your Postgres index can be used by a specific...

github.com

The issue: You are using stub_const to change a constant value for your test. stub_const "SomeClass::CONST", 'test...

makandra dev
makandracards.com

Rails applications and ruby gems should have a README that gives the reader a quick overview of the project. Its...

jsbin.com

If you try to listen to events on elements that are nested inside a , Firefox will stop event propagation once...

By default, browsers will not wrap text at syllable boundaries. Text is wrapped at word boundaries only. This card explains...

postgresql.org

PostgreSQL's Common Table Expressions (CTEs) can be used to extract sub-queries from bulky SQL statements into a temporary...

relishapp.com

In most projects I know, Cucumber test suite speed is not an issue. Of course, running 350 features takes its...

georgemauer.net

If your application exports CSV, be advised that Excel and other spreadsheet applications treat certain cells (those starting with =, +, - or...

Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...

RSpec allows you to mark a single Example/ExampleGroup so that only this will be run. This is very useful when...

If you already selected an element and want to get its parent, you can call find(:xpath, '..') on it.

makandra dev

An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...

When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...

Browsers support different types of redirects. Be very careful with these status codes: 301 Moved Permanently 308 Permanent Redirect

When you want to group rails models of a logical context, namespaces are your friend. However, if you have a...

RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...

When localizing model attributes via I18n you may run into errors like this: I18n::InvalidPluralizationData: translation data {...

...} can not be...