**Situation:**

An order is created by ordercontroller create method into a orders table.

Then a video is uploaded by videoordercontroller create method into the videoorder table associated with the order\_id.

I have this in the orders show page to upload the video to the order:

```
<%= form_for([@order, @video_order]) do |form| %>
  <%= form.file_field :video %>
<%= form.submit "Upload", class: "btn btn-success"  %>

```

This form technically disapears after submission but i am testing updating the video because i also want to give the ability to update the video in case a wrong video is uploaded.

I tried:

```
<%= form_for([@order, @video_order], :url => edit_order_video_order_path(@order.id, @video_order), remote: true ) do |form| %>
   <%= form.file_field :video %>
 <%= form.submit "Upload", class: "btn btn-success"  %>

```

But this gives me the

```
"(No route matches [POST] "/orders/150/video_orders/150/edit")"

```

Which, of course this wouldn't work but i also can't figure out how to allow to update the video tables order\_id from the same URL page. I don't want to send the user to a new page for convenience.

So basically, how can i allow updating the orders video in the video table?

**Here's the models:**
video\_order model

```
belongs_to :order
validates :order_id, uniqueness: true

```

order order model

```
has_one :video_order

```

The video\_order model has the order\_id and video only.
the order model doesn't have a video\_id column.

Also, if you see any associations being wrong or have better ways, feel free to let me know.

Rake:

```
edit_order_video_order GET    /orders/:order_id/video_orders/:id/edit(.:format)                                        video_orders#edit

PATCH  /orders/:order_id/video_orders/:id(.:format)                                             video_orders#update
PUT    /orders/:order_id/video_orders/:id(.:format)                                             video_orders#update

```

This is taking place in the Order show page

I have this method in the order controller:

```
def show
    @user = current_user
    @video_order = VideoOrder.new
end

```

This where the uploading of the video takes place. i also want to allow updating from it with a seprate form