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