Closed andyrue closed 2 years ago
Hey! Yeah, that's because you have poa_attachment
column in your model. You can check how SimpleForm detects file inputs here https://github.com/heartcombo/simple_form/blob/86429bceb950096df3c29616f31bd5a5ce706c06/lib/simple_form/form_builder.rb#L592. So for your case you can use as: :string
to avoid it. Unfortunately it's hard to make it work properly for all the case.
Environment
Current behavior
I have a varchar column field named "poa" inside a table named "poas". When I use f.input on that field it is being wrapped in a div with a "file" class and has an
input type='file'
. I have recently upgraded from Rails 4.2 and Simple_Form 4.0 and this wasn't an issue before. I'm not having this problem with any other varchar field. The only things special about this column is it is named the same as the model, and there is also apoa_attachment
column that is used for acarrierwave uploader
. Not sure if there is some sort of magic happening in the background that is getting some wires crossed or something.This is the resulting html
Expected behavior
I expect the field to be treated as a text input. I can get around it by adding
as: :string
to the field, but I shouldn't have to do that.