ga-wdi-exercises / project2

[project]
1 stars 30 forks source link

Making image links clickable #831

Closed Nykke closed 7 years ago

Nykke commented 7 years ago

I'm getting this message

undefined method `symbolize_keys' for # Extracted source (around line #8):

<% @categories.each do |category| %>
  <a href="/categories/<%= category.id%>">
  <%= image_tag category.img_url, @categories %>

  <% end %>
nayana487 commented 7 years ago

Are you calling the symbolize_keys method anywhere in your code?

nayana487 commented 7 years ago

So it looks like this error happens when you're passing some other kinda value where rails is expeting a hash.

http://stackoverflow.com/questions/14806407/undefined-method-symbolize-keys-for-2fixnum

Nykke commented 7 years ago

I not, I'm not sure how to use it.

nayana487 commented 7 years ago

can you screenshot the whole error you're getting? what's happening is that ruby/rails is expecting a hash somewhere and you're passing in some other value

Nykke commented 7 years ago

I got it fixed, I had my path incorrect and was referencing the class variable

nayana487 commented 7 years ago

👍