So I'm trying to set a conditional statement for what images should be displayed
This is the section in my home/index view file
<% if @cloth.gender == "Female" && @cloth.size == "2T-3T" || "4T-5T" %>
This returns an error in the browser:
undefined method `gender' for #<Array:0x4d2c578>
I set the home controller to:
def index
@cloth = Cloth.all
end
So it should be able to access all of "cloth", but it isn't. When I go into the rails console I can access cloth.gender. Not sure what to do here...
Entire code available at https://github.com/yahtaa/oslr