recreating in rails