diff options
author | hellekin <hellekin@cepheide.org> | 2020-10-09 11:47:28 +0200 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2020-10-09 11:47:28 +0200 |
commit | 156f0a221ea5d68b8a47ffa959d48d3639cb7e97 (patch) | |
tree | 00ec0f49a29bacf5d374b4a9f8465ec82fb9e800 | |
parent | f193e708285db21e9e3dffbe96c9961a9865e2db (diff) | |
download | incommon-map-156f0a221ea5d68b8a47ffa959d48d3639cb7e97.tar.gz |
Wrap debug with login
To avoid breaking on logout
-rw-r--r-- | app/views/welcome/index.html.erb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 1977962..1b6ab77 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -12,10 +12,12 @@ <%= tag.div(id: 'map') %> <% content_for :debug do %> - <p>Premier élément de la liste:</p> - <% res = @resources.first %> - <p><%= res.feature["properties"]["name"] %></p> - <p><%= res.feature["geometry"]["coordinates"] %></p> + <% if current_user.present? %> + <p>Premier élément de la liste:</p> + <% res = @resources.first %> + <p><%= res.feature["properties"]["name"] %></p> + <p><%= res.feature["geometry"]["coordinates"] %></p> + <% end %><%# ensure it does not break when we don't have a record... %> <% end %> <% content_for :body_end do %> |