fix modal open
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user