From d242fb5bbc423876f4c192b5f133619a2d4f0113 Mon Sep 17 00:00:00 2001 From: hellekin Date: Fri, 9 Oct 2020 10:29:34 +0200 Subject: Scope routes to Agent Since an Agent is required for all records, we scope the routes and get it present for free ;) This commit also adds resource views. --- app/views/application/_user_info.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/application') diff --git a/app/views/application/_user_info.html.erb b/app/views/application/_user_info.html.erb index 8e90501..3220c89 100644 --- a/app/views/application/_user_info.html.erb +++ b/app/views/application/_user_info.html.erb @@ -6,7 +6,7 @@ <%= tag.li(link_to(new_agent_switch_url, method: :get, remote: true, title: "Changer d'Agent") do "Agent: %s" % current_agent end, id: 'current_agent_name') %> - <%= tag.li link_to("Ajouter un point", new_resource_url) %> + <%= tag.li link_to("Ajouter un point", new_agent_resource_url(agent_id: current_agent)) %> <%= tag.li link_to("Mon compte", account_url(current_user.id)) %> <%= tag.li link_to("Terminer la session", logout_url) %> -- cgit v1.2.3