aboutsummaryrefslogtreecommitdiff
path: root/app/views/resources/_edit.html.erb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-09 12:47:31 +0200
committerhellekin <hellekin@cepheide.org>2020-10-09 12:47:31 +0200
commitdd9e0691acae3eb63bdfbc8665eb3f8ce516536d (patch)
tree41d5889f2a0882b4f4356ed60683e908abf0b208 /app/views/resources/_edit.html.erb
parentfd9e9c4679ea36bed60acf01a43dda307db203e4 (diff)
downloadincommon-map-dd9e0691acae3eb63bdfbc8665eb3f8ce516536d.tar.gz
Fix Resource edition
Diffstat (limited to 'app/views/resources/_edit.html.erb')
-rw-r--r--app/views/resources/_edit.html.erb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/views/resources/_edit.html.erb b/app/views/resources/_edit.html.erb
index fdb2921..55c59f6 100644
--- a/app/views/resources/_edit.html.erb
+++ b/app/views/resources/_edit.html.erb
@@ -1,6 +1,6 @@
-<h3>Edit <%= resource.presence&.name || 'new resource' %></h3>
+<h3>Edit <%= @resource.presence.feature['properties']['name'] || 'new resource' %></h3>
<h2>Context: <%= current_agent %></h2>
-<%= form_with model: [current_agent,@resource] do |f| %>
+<%= form_with model: [current_agent,@resource], url: controller.action_name == 'new' ? agent_resources_path(agent: current_agent) : resource_path(@resource) do |f| %>
<%= render partial: 'form', locals: { resource: resource, f: f } %>
<% end %>