The “/new” form to create a new instance of my model requires a file to be uploaded and parsed. The file itself isn’t an attribute of the model. However the result of the parsed file is. How can I pass the file to my controller in order to parse it, if the file isn’t a model attribute. In other words, how can I put a input field for it on the view, and how can it be accessed on the controller?
Share
If you add
attr_accessor :virtual_fieldto your model, it will add model.virtual_field= and model.virtual_field methods for you. These are memory attributes that don’t get saved to db.