Carrier wave in edit form

I use a partial form to create and edit a model object that contains a loader ("file"):

= simple_form_for(@document) do |f|
= f.error_notification

.form-inputs
  = f.input :event_id
  = f.input :name
  = f.input :file
  = f.hidden_field :file_cache

.form-actions
  = f.button :submit

In the edit form, instead of getting the file name associated with an already downloaded file, I get "No file selected". is there any way to make the widget acknowledge that the bootloader is non-zero and use the file name from the bootloader?

+5
source share
1 answer

. , , , @document.file? , . File_cache , . , , "no file".

, , , , , , , - " ", @document.file if @document.file? .

+3

All Articles