Ruby Literals Percent Notation

A quick reference to format literals. %q[ ] Non-interpolated String (except for \\ \[ and \]) %Q[ ] Interpolated String (default) %r[ ] Interpolated Regexp (flags can appear after the closing delimiter) %i[ ] Non-interpolated Array of symbols, separated by whitespace...

Value Objects in Rails

It is common to have custom data types in an application (whether implicitly coded or not). For example, I have an application which has a ‘sales month’ data type which is a year and month. I store it in the database as a date with the day field set to...

Javascript nested forms for has_many relationships

The idea is with a one to many relationship you click a button on the form to add another child. For example, on a personal information form, you could click “new phone” and another phone number subform would be added. A key point is that this does *not*...