stackoverflow.com

Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...

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

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

This is painful. Consider using Microsoft Office or switching careers. If you need to write < 20 letters consider doing it...

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

Let's say you have a form that you render a few times but you would like to customize your...

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

...} can not be...

api.rubyonrails.org

Rails 5 (don't know about the others) comes with an initializer wrap_parameters.rb. Here you can tell rails to wrap...

github.com

When storing a file with Carrierwave, it is always cached prior to actually storing it (to support form roundtrips).

When filling out forms in Selenium tests, Chrome shows the (usual) bubble, asking to store those credentials. While the bubble...

Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...

This card is just about creating simple PostgreSQL dumps. This is no instruction for a backup strategy nor a guide...

There are various ways to run external commands from within Ruby, but the most powerful ones are Open3.capture3 and Open3.popen3...

First find the reference for the entry you want through looking at the stash: $ git stash list stash@{0}: WIP...

smashingmagazine.com

A comprehensive introduction to sending HTML emails. Intro: HTML email: Two words that, when combined, brings tears to a developer...

In general, you should not put a block element inside an inline element. So don't do this: text

Exercise 1: XML On the start page of your Movie DB, show the title of a random movie that is...

Building plain text emails with an .erb template doesn't allow you to indent code like you normally do in...

This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop...

clipboardjs.com

We used zeroclipboard.js in some of our projects but now we switched to clipboard.js because it does not rely on...

makandra dev
github.com

Improve geordi cucumber: Only attempt @solo run when the specified files contain the @solo tag, skip @solo run if any...

Resources Rails Guide: Internationalization API Guide to localizing a Rails application Locale-aware helpers in ActionView::Helpers::NumberHelper

When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...