mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 16:45:18 +08:00
Testing why rubocop gives errors
This commit is contained in:
parent
79e065a811
commit
2bfe8f0b95
2 changed files with 19 additions and 20 deletions
|
@ -638,7 +638,7 @@ class ProtocolsController < ApplicationController
|
|||
]
|
||||
description_string = Sanitize.clean(params['protocol']['description'])
|
||||
description_array.each do |element|
|
||||
if element == 'created_on'
|
||||
if element == 'created_on' #združ
|
||||
if @json_object[element] && @json_object[element] != ''
|
||||
new_element = element.slice(0, 1).capitalize + element.slice(1..-1)
|
||||
new_element = new_element.tr('_', ' ')
|
||||
|
@ -648,7 +648,7 @@ class ProtocolsController < ApplicationController
|
|||
Sanitize.clean(params['protocol']['created_at'].to_s) + "\n"
|
||||
end
|
||||
else
|
||||
if element == 'tags'
|
||||
if element == 'tags' #združ
|
||||
if @json_object[element].any? && @json_object[element] != ''
|
||||
new_element = element.slice(0, 1).capitalize + element.slice(1..-1)
|
||||
new_element = new_element.tr('_', ' ')
|
||||
|
|
|
@ -146,29 +146,28 @@ CGI.parse(URI.parse(request.referrer).query).fetch("type") %>
|
|||
<div data-val="description" class="ql-editor">
|
||||
|
||||
<% step["components"].each do |key,value| %>
|
||||
|
||||
<%#here i made an if to distinguish the first step from the
|
||||
others, because the first step #sometimes has index values as keys instead of
|
||||
hashes, you might see this elsewhere %>
|
||||
<% if value.class==Hash %>
|
||||
<% key=value %>
|
||||
|
||||
<% end %>
|
||||
<% # the below blocks of code output the various attributes if they exist and arent null or "" from the json object %>
|
||||
|
||||
<% if whitelist_simple.include?(key["component_type_id"]) && key["data"]!="" && key["data"] %>
|
||||
<br>
|
||||
<% case key["component_type_id"]%>
|
||||
<% when "1" %>
|
||||
<br>
|
||||
<strong>Description:
|
||||
<strong>
|
||||
Description:
|
||||
</strong>
|
||||
<%=key["data"]%><br>
|
||||
<% when "17" %>
|
||||
<br>
|
||||
<strong>Expected result:
|
||||
</strong>
|
||||
<%=key["data"]%><br>
|
||||
<% else %>
|
||||
<%=key["data"]%>
|
||||
<br>
|
||||
<% end %>
|
||||
<% elsif key && whitelist_complex.include?(key["component_type_id"]) %>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue