From 611a88192579f5f460e0d1faf621e079d185c223 Mon Sep 17 00:00:00 2001 From: Paul Crossley Date: Tue, 28 May 2024 11:44:27 +0100 Subject: [PATCH] add to edit --- app/controllers/projects_controller.rb | 2 ++ app/views/projects/edit.html.erb | 37 +++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index abd523f0..51559764 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -49,6 +49,8 @@ def update existing_source = @project.source || {} existing_source["name"] = params.require(:project).require(:name) existing_source["extent"] = params.require(:project).require(:extent).split(",").map(&:to_f) + existing_source["cql"] = params.require(:project).require(:cql) + existing_source["layer"] = params.require(:project).require(:layer) if @project.update(source: existing_source) if params[:commit] == 'Save and open project' diff --git a/app/views/projects/edit.html.erb b/app/views/projects/edit.html.erb index 6ba0c2fa..de61f569 100644 --- a/app/views/projects/edit.html.erb +++ b/app/views/projects/edit.html.erb @@ -39,6 +39,11 @@
+
+ <%= f.hidden_field :layer, class: 'form-control', value: (@project.layer.present? ? @project.layer : '') %> + <%= f.hidden_field :cql, class: 'form-control', value: (@project.cql.present? ? @project.cql : '') %> +
+ <%= link_to 'Cancel', :back, class: 'btn btn-secondary' %> <%= f.submit 'Save and open project', class: 'btn btn-primary' %> @@ -48,16 +53,42 @@