I'm totally confused ... I'm using form_for helper:
<%= form_for @foods do |f| %> <% end %> @foods defined in the controller as:
def index @foods = Food.all end migration is defined as:
create_table "foods", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false t.datetime "updated_at", null: false end The model is defined as:
class Food < ActiveRecord::Base end so the rails (gem 'rails', '4.2.6') on ruby (ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]) give:
undefined method `to_key 'for" #Food :: ActiveRecord_Relation: 0x00000002af6f98 "Did you mean? to_query to_ary
What am I doing wrong ???
Food.all. What sense did you put into it? - D-side