From cf6b277ca3f22e575b059a8d8029163ddcee86db Mon Sep 17 00:00:00 2001 From: hellekin Date: Tue, 6 Oct 2020 21:59:13 +0200 Subject: Fix form, add flash --- app/views/resources/edit.html.erb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'app/views/resources') diff --git a/app/views/resources/edit.html.erb b/app/views/resources/edit.html.erb index 7e9799f..fa61a0a 100644 --- a/app/views/resources/edit.html.erb +++ b/app/views/resources/edit.html.erb @@ -1,6 +1,15 @@ -<%= form_with model: @resource do |f| %> - <%= f.label :name, "Name of this Resource" %> - <%= f.text_field :name %> +<%= form_with model: @resource, local: true do |f| %> + <%= f.label :name %> + <%= f.text_field :name, value: @resource.name %> + + + <%= tag.legend "Geographic Position" %> + <%= f.label :longitude %> + <%= f.text_field :longitude, value: @resource.lon %> + <%= f.label :latitude %> + <%= f.text_field :latitude, value: @resource.lat %> + + <%= f.submit 'Save' %> <% end %> -- cgit v1.2.3