fix a bug about using case/when in erb