Generate Rails code