Skip to content

Commit

Permalink
Move logic to the view
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Jul 22, 2024
1 parent c3c225a commit 6b038ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 0 additions & 5 deletions app/controllers/investigations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ def ro_for_download
headers["Content-Length"]=ro_file.size.to_s
end

def new
@investigation = Investigation.new
@investigation.is_isa_json_compliant = Seek::Config.isa_json_compliance_enabled ? true : false
respond_to(&:html)
end
def create
@investigation = Investigation.new(investigation_params)
update_sharing_policies @investigation
Expand Down
3 changes: 2 additions & 1 deletion app/views/investigations/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<% object ||= nil %>
<% isa_json_compliance_default = @investigation.new_record? ? Seek::Config.isa_json_compliance_enabled : @investigation.is_isa_json_compliant %>
<%= f.error_messages -%>

Expand Down Expand Up @@ -26,7 +27,7 @@
<% if @investigation.studies.any? %>
<%= f.check_box :is_isa_json_compliant, disabled: "disabled"%>
<% else %>
<%= f.check_box :is_isa_json_compliant%>
<%= f.check_box :is_isa_json_compliant, checked: isa_json_compliance_default %>
<% end %>
<%= "Make #{t('investigation')} compliant to ISA-JSON schemas?" %>
</label>
Expand Down

0 comments on commit 6b038ed

Please sign in to comment.