sanitize_to_id is a method used in rails when generating id, so i think it should be here.
(by default it's sanitize_to_id(k))