Conversion of CB to Rails