It looks like an error you received from the following line in form_helper.rb:
object_name = options[:as] || ActiveModel::Naming.param_key(object)
If you specified hardcode: as => "Entry", you will get a little further. Or you can extend the class to respond to the model_name method. Here is the code in ActiveModel :: Naming that calls the model name:
def self.model_name_from_record_or_class(record_or_class) (record_or_class.is_a?(Class) ? record_or_class : convert_to_model(record_or_class).class).model_name end
I could continue to follow the challenges, but I would recommend that you follow it yourself. In the end, you will find a call that returns a hash of the attributes and values ββthat the form builder uses in form_for.
Just look at the source of the rails, see where your code is causing the error, and extend your class to answer the correct call. Keep doing this and your model will respond normally. You do not have to be an activerecord model to look, walk and sound like an activerecord model.
source share