-2

I have this controller with a hash in the index.

suggestions_controller.rb

class SuggestionsController < ApplicationController
    def index
        @mercs = {
            'Proxy' => './mercs/proxy.png',
            'Arty' => './mercs/arty.png',
            'Aura' => './mercs/aura.png'
        }
    end
end

When I transfer it to my view,

index.html.erb

<div class="merc-list">
    <%= @mercs.each do |merc, img| %>
        <div class="merc">
        </div>
    <% end %>
</div>

my view displays the raw hash:

Problem

I also tried with a regular array (with no hash), and it displays the raw array in my view.

sawa
  • 165,429
  • 45
  • 277
  • 381
Student22
  • 1,979
  • 5
  • 22
  • 33

1 Answers1

1
    <%= @mercs.each do |merc, img| %>

should be

    <% @mercs.each do |merc, img| %>
oowowaee
  • 1,635
  • 3
  • 16
  • 24