Skip to content

Instantly share code, notes, and snippets.

View carlos-ht's full-sized avatar
♦️

Carlos E. Hernández carlos-ht

♦️
View GitHub Profile
@fmasuhr
fmasuhr / gist:4fd661b884f157590613
Last active June 27, 2022 03:25
Associate a Vagrant project directory with an existing VirtualBox VM
  1. Run the following command and copy the ID of your VM
VBoxManage list vms
=> "virtualMachine" {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
  1. Go to the Vagrant project configuration folder
Just discovered this: an easy way to humanize the attributes of a model. Allows you to rename the database column name to something more reasonable. Makes for nicer, more understandable error messages back to the user.
class User < ActiveRecord::Base
HUMANIZED_ATTRIBUTES = {
:user_email => "E-mail address"
}
def self.human_attribute_name(attr)
HUMANIZED_ATTRIBUTES[attr.to_sym] || super