I have a database field called file_type. I want to compare it against
an array of types to either display it as an image or just create a link
to it. I am sure there is an easy way to do this but I can’t think of
I don’t want to do this:
<% if resource.file_type == “.png” OR resource.file_type == “.jpg” …
I would like to do:
<% if resource.file_type == [".png", “.jpg”, “.gif”, …] %>
What do you think?