Forms using polymorphic associations and namspaces

Routes

namespace :admin do resources :events do resources :images, module: :events end

Form
<%= form_with(model: [@event, Image.new], local: true) do | form | %>

Rails is trying to access this url: event_images_path

I need this url: admin_event_image

You can specify the admin namespace in your model like this

<%= form_with(model: [:admin, @event, Image.new], local: true) do | form | %>