Question: When upload pictures, everything goes okay.
But on edit, it doesn't display the file fields value. Just an empty file\_field, like nothing is there. Pic title displays correctly.
Other text is in hungarian.

![enter image description here](https://i.stack.imgur.com/VIVoE.png)

\_form.html.haml

```
= simple_nested_form_for(@post) do |f|
  = f.input :title, label: 'Cím'
  = f.input :body, label: "Test"
  = f.fields_for :pics do |pic_form|
    = pic_form.text_field :title
    %br/
    = pic_form.file_field :image
    = pic_form.link_to_remove "Kép Törlése", class: "btn btn-warning"
    %br/
  %br/
  %p= f.link_to_add "Kép hozzáadása", :pics, class: "btn btn-success"
  %br/
  %br/
  = f.submit "Mentés", class: "btn btn-primary"
= javascript_include_tag :defaults, "nested_form"

```

How to pass, the existing file to the file\_field?

Answer: 
You have to use a conditional to find out if the file(s) is/are attached. Using [ActiveStorage](https://edgeguides.rubyonrails.org/active_storage_overview.html), the conditional could look like this (for a field that accepts only one file): 

```
<% if @my_object.my_file.attached? %>
  <%= @my_object.my_file.blob.filename %>
<% else %>
  <%= f.file_field :my_file %>
<% end %>

```

If the field accepts many files, you have to iterate to show the filenames:

```
<% @my_object.my_files.each do |i| %>
  <%= i.filename %><br>
<% end %>

```

I am sure there is a corresponding way to handle this in Carrierwave.
I guess this is the default behavior of the file field. On editing a particular action, the id of the file is stored in the file field rather than its entire value. 
In the code, I can see that you have used the field for and therefore, a relationship would have been setup between post and pic. So, on close inspection, you would find that Rails would send in the id of the file to the server when you click on the Submit button which is an indication that there is no need to upload or process the pic. However, if you select some file in the file field, then you can see that it does the actual uploading the file. This processing is well handled by Paperclip gem also.