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/welcome/dashboard.html.erb | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'app/views/welcome') diff --git a/app/views/welcome/dashboard.html.erb b/app/views/welcome/dashboard.html.erb index 81264e2..8880434 100644 --- a/app/views/welcome/dashboard.html.erb +++ b/app/views/welcome/dashboard.html.erb @@ -1,5 +1,15 @@

Welcome <%= h current_user.name %>!

-

Current Agent: <%= current_user&.agencies&.first&.agent&.name %>

+

Current Agent: <%= current_agent&.name %>

-

Cool, what can we do now?

+
+

Global Count

+

<%#= @stats[:counts].map { |k,v| pluralize(k.to_s.singularize, v) }.to_sentence %>

+

<%= p @stats[:count] %> +

+ +
+

Current Agent: <%= current_agent %>

+

<%#= @stats[:current_agent][:counts].map { |k,v| pluralize(k.to_s.singularize, v) }.to_sentence %>

+ <%= render partial: current_agent %> +
-- cgit v1.2.3