mercredi 7 novembre 2018

Problems with a include or if in rails

Im having issues with rails with the code

if @turno.chop == res[:department].to_s 

where turno contains strings like ABC1 and department like ABC, im trying to filter if turno its equal of department but i need reduce the string of turno for that. Every time what i try to do that the code dont finish and stuck in other part of code, when i delete the condition, the code works perfectly but dont do the filter.

i tryid to to do like

if @turno.include?(res[:department].to_s)

But appears the same error.

Aucun commentaire:

Enregistrer un commentaire