I am using Ruby on Rails and have a form that gets information from user input. I then want to take the user input and write it to a text file on the server side. I hope to save the …
I have a value 'Dog' and an array ['Cat', 'Dog', 'Bird'].
How do I check if it exists in the array without looping through it? Is there a simple way of checking if the value exists, nothing more?