aboutsummaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-09 12:48:13 +0200
committerhellekin <hellekin@cepheide.org>2020-10-09 12:50:16 +0200
commit383a840c50ca8f6df19677e93357e9dc6c0e043c (patch)
tree3597f5ee2a92b551a01ac207f440ae85bcb3d9c6 /app/helpers
parentdd9e0691acae3eb63bdfbc8665eb3f8ce516536d (diff)
downloadincommon-map-383a840c50ca8f6df19677e93357e9dc6c0e043c.tar.gz
Enable switching Agent
Switching current Agent can help with roles and resource access. Go to your dashboard by clicking the avatar. Select agent and hit "Select"
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/agents_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/helpers/agents_helper.rb b/app/helpers/agents_helper.rb
new file mode 100644
index 0000000..a02fb7a
--- /dev/null
+++ b/app/helpers/agents_helper.rb
@@ -0,0 +1,9 @@
+module AgentsHelper
+ # Form to select an Agent
+ def agent_selector_form
+ form_for current_agent, url: '/my/current_agent', method: :patch do |f|
+ f.submit('select')
+ f.select(:id, options_for_select(current_user.agents.map { |a| [a.name, a.id] }), selected: current_agent.id)
+ end
+ end
+end