RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12224

How can I add non-model fields to a simple_form?

I need to add a non-model field to a simple_form. Several actually. But I get this error:

ActionView::Template::Error (undefined method `parameter_id_17' for #<ReportDefinition:0x007fdc22aad088>):

This is within a fields_for block. I know it's undefined for the model I'm trying to use it for. I was hoping I could still use simple_form and not have to resort to the Rails native tags.

Upvotes: 0

Views: 426

Answers (1)

Peter DeVries
Peter DeVries

Reputation: 73

In you model you can add:

attr_accessor :something, :something_else

Upvotes: 1

Related Questions