mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-05 23:25:46 +08:00
Fixed a bug, where if the url get query is nil (if you go directly to /protocols, it doesnt get the public type from url, now when it is nil it just defaults to public
This commit is contained in:
parent
b23ca33e73
commit
64b72f4ad4
1 changed files with 6 additions and 2 deletions
|
@ -1,8 +1,12 @@
|
|||
<%= form_for(@protocol, :url => url_for(:controller => 'protocols', :action=>'protocolsio_import_save'),method: :post,format: :javascript,remote: true,:html=> { :id => "protocolsio-import-form" }) do |f| %>
|
||||
|
||||
<%= hidden_field_tag :json_object, JSON.generate(@json_object) %>
|
||||
<%= hidden_field_tag :type,
|
||||
CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
|
||||
|
||||
<% if URI.parse(request.referrer).query %>
|
||||
<%= hidden_field_tag :type,CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :type,"public" %>
|
||||
<% end %>
|
||||
<!--Get the type of protocol to import (private, public) from the url -->
|
||||
<div
|
||||
id="modal-import-json-protocol-preview"
|
||||
|
|
Loading…
Reference in a new issue