grs re-write  in rails