Skip to content

Instantly share code, notes, and snippets.

View GNURub's full-sized avatar
🏠
Working from home

Rubén GNURub

🏠
Working from home
View GitHub Profile
@GNURub
GNURub / index.html
Last active August 29, 2015 14:06 — forked from hdragomir/index.html
<script type="text/javascript">
(function (css_href) {
"use strict";
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
} else if (el.attachEvent) {
el.attachEvent("on" + ev, callback);

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one