aboutsummaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
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