From dd9e0691acae3eb63bdfbc8665eb3f8ce516536d Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 9 Oct 2020 12:47:31 +0200 Subject: Fix Resource edition --- app/views/resources/_edit.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/resources/_edit.html.erb') 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 @@ -

Edit <%= resource.presence&.name || 'new resource' %>

+

Edit <%= @resource.presence.feature['properties']['name'] || 'new resource' %>

Context: <%= current_agent %>

-<%= 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 %> -- cgit v1.2.3