diff options
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 %> |