I'm running the grep method to filter by pattern matching. This is an example code.
companies.grep /city/
However, ruby isn't allowing me to input the area_code withing the block inside the rails view. Instead, I'm forced to hardcode it like so:
companies.grep /miami/
Keep in mind, city is a variable. For example,
city = miami
However, it updates. Do you know how can I pass a variable through the grep method?
Also, I tried companies.grep /#{city}/, but it didn't work