I have a index action in my rails 3.2.6(ruby 1.9.3) app. In the view i am simply looping over all the records in the database.When I hit the index action in the browser it displays all the records present in the database as an array at the end of the page any pointers what the problem might be?
Share
Seeing the code for your view would help a lot. My guess, you are likely printing out the value of the
eachcall.eachreturns the array after it loops through all of the elements. If you are using erb, below should work:Change
<%= @records.each do |record| %>to
<% @records.each do |record| %>