jeudi 12 novembre 2015

Rails 3 and form_for ActionView::Template::Error (undefined method `param_key' for "Class":String):

I'm trying to make a non-model form using form_for but getting the folliwing error, what is wrong?

ActionView::Template::Error (undefined method `param_key' for "Class":String):

My non active-record model

class Task < OpenStruct
  extend ActiveModel::Naming
  include ActiveModel::Conversion

  // a bunch of code here

  def persisted?
    false
  end
end

And my html.erb view

<%= form_for @task, url: form_url do |f| %>

Aucun commentaire:

Enregistrer un commentaire