diff options
author | hellekin <hellekin@cepheide.org> | 2020-10-06 21:59:13 +0200 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2020-10-06 21:59:13 +0200 |
commit | cf6b277ca3f22e575b059a8d8029163ddcee86db (patch) | |
tree | 960074763696f58860f2a57d009c3dba90fe1e6a /app/views | |
parent | 8c7c0501e49871765d6ac971e4027dac0ea20407 (diff) | |
download | incommon-map-cf6b277ca3f22e575b059a8d8029163ddcee86db.tar.gz |
Fix form, add flash
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/application/_flash.html.erb | 3 | ||||
-rw-r--r-- | app/views/layouts/application.html.erb | 1 | ||||
-rw-r--r-- | app/views/resources/edit.html.erb | 15 |
3 files changed, 16 insertions, 3 deletions
diff --git a/app/views/application/_flash.html.erb b/app/views/application/_flash.html.erb new file mode 100644 index 0000000..0b5cc5f --- /dev/null +++ b/app/views/application/_flash.html.erb @@ -0,0 +1,3 @@ +<div id="flashes"><% flash.each do |type, msg| %> + <span class="<%= type %>"><%= msg %></span> +<% end %></div> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4aae3ea..38dcf46 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -26,5 +26,6 @@ <footer> <%= yield :footer %> </footer> + <%= render partial: 'flash' %> </body> </html> 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 %> |