Skip to content

Instantly share code, notes, and snippets.

@axilaris
Created April 26, 2014 07:39
Show Gist options
  • Select an option

  • Save axilaris/11314196 to your computer and use it in GitHub Desktop.

Select an option

Save axilaris/11314196 to your computer and use it in GitHub Desktop.
in controller
def index
@customers = Customer.all
end
in erb
this doesnt work:
<% raw @customers.count %>
<% raw @customers.first.company %>
this works:
<% @customers.each do |customer| %>
<tr>
<td><%= customer.company %></td>
</tr>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment