fix modal open

master^2
Pete Matsyburka 6 days ago
parent 1536ded2a6
commit 809c6b1aa8

@ -20,9 +20,10 @@
</head> </head>
<body> <body>
<% if params[:modal].present? %> <% if params[:modal].present? %>
<% url_params = Rails.application.routes.recognize_path(params[:modal], method: :get) %> <% modal_uri = Addressable::URI.parse(params[:modal]) %>
<% url_params = Rails.application.routes.recognize_path(modal_uri.path, method: :get) %>
<% if url_params[:action] == 'new' %> <% if url_params[:action] == 'new' %>
<open-modal src="<%= url_for(url_params) %>"></open-modal> <open-modal src="<%= url_for(**url_params, params: modal_uri.query_values) %>"></open-modal>
<% end %> <% end %>
<% end %> <% end %>
<turbo-frame id="modal"></turbo-frame> <turbo-frame id="modal"></turbo-frame>

Loading…
Cancel
Save