added rails code