array in view

I want my view to print the category names but my browser’s displaying an array first, then the category name Why is it displaying this array I am using acts_as_nested_set in my controller but I don’t think that should be the issue

<%= @categories.each do |category| %> <% end %>
<%= category.name %>

Only use <%= for text output

Change <%= on array iterate to <% only

<%= @categories.each do |category| %> <% @categories.each do |category| %>