LOL why didn't I see this earlier?
Could it be I am rendering the form on index.html.erb?
Yep, it's totally the problem. Reason is here:
Problem::ActiveRecord_Relation:Class
You're getting back a relation
object (defines a collection, rather than single record). This is caused by this:
#controller
def index
@problem = Problem.all
end
The error is beacuse form_for
expects a single record. You need to use this in your controller & it will work:
#controller
def index
@problem = Problem.new
@problems = Problem.all
end
#view
<%= @problems.each do |problem| %>
<%= problem.name %>
<% end %>
<%= form_for @problem do |f| %>