I'm working with heroku in app made in Rails 5.1.1 wich uses Cloudinary like image server and atacchinary to upload it.
This is the first time I use attachinary with rails 5, and when I upload the image with the input <%= f.attachinary_file_field :image_event %>, it works fine. The image is uploaded and I can see it on cloudinary dashboard.
The question is: wuen I going to create the information, it returns to edit the infos in the crud with a error in the file input.
Saying: Image files is invalid
I think its something with association, because the image is uploaded, but I dont have sure. The error occurs in development and in production.
The field is already in required parameters on controller
development:
cloud_name: xxxxxxxxxxxxx
api_key: 'xxxxxxxxxxxxx'
api_secret: xxxxxxxxxxxxx
enhance_image_tag: false // changed to false to work with rails 5
static_image_support: false
production:
cloud_name: xxxxxxxxxxxxx
api_key: 'xxxxxxxxxxxxx'
api_secret: xxxxxxxxxxxxx
enhance_image_tag: false
static_image_support: false
test:
cloud_name: xxxxxxxxxxxxx
api_key: 'xxxxxxxxxxxxx'
api_secret: xxxxxxxxxxxxx
enhance_image_tag: true
static_image_support: true
My Model Event:
has_attachment :image_event, accept: [:jpg, :png, :gif]