hooking up to rails