aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/resources/_edit.html.erb4
-rw-r--r--app/views/resources/_resource.html.erb10
-rw-r--r--app/views/resources/edit.html.erb2
3 files changed, 8 insertions, 8 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 %>
diff --git a/app/views/resources/_resource.html.erb b/app/views/resources/_resource.html.erb
index f013523..585bed8 100644
--- a/app/views/resources/_resource.html.erb
+++ b/app/views/resources/_resource.html.erb
@@ -1,9 +1,9 @@
<section id="resource-<%= resource.uuid %>">
<header>
- <h2><%= h resource.name %></h2>
+ <h2><%= resource.properties['name'] %></h2>
<time datetime="<%= h resource.created_at %>" class="created_at">
- <time datetime="<%= h resource.updated_at %>" class="updated_at">
- <p class="identifier"><%= resource_url(resource) %></p>
+ <time datetime="<%= h resource.updated_at %>" class="updated_at">
+ <p class="identifier"><%= resource_url(resource) %></p>
</header>
<div><%= h resource.description %></div>
<hr>
@@ -13,8 +13,8 @@
<ul>
<li><%= link_to('show', resource_url(resource)) %></li>
<% if session[:current_agent] == resource.source %>
- <li><%= link_to 'edit', edit_resource_url(resource) %></li>
- <li><span class="disabled">delete</span></li>
+ <li><%= link_to 'edit', edit_resource_url(resource) %></li>
+ <li><span class="disabled">delete</span></li>
<% end %></ul>
</nav>
</section>
diff --git a/app/views/resources/edit.html.erb b/app/views/resources/edit.html.erb
index 80d8206..b52c60d 100644
--- a/app/views/resources/edit.html.erb
+++ b/app/views/resources/edit.html.erb
@@ -1,2 +1,2 @@
-<%= render partial: 'edit', locals: { resource: @resource } %>
+<%= render partial: 'edit', locals: { resource: @resource, foo: 'foo' } %>