%= bootstrap_form_for(@host, layout: :horizontal, label_col: 'col-xs-3', control_col: 'col-xs-8') do |f| %> <% if current_user.needs_host_list? %> <%= f.select :fqdn, options_for_select(@hosts_of_user, @host.fqdn), {}, disabled: @host.persisted? %> <% else %> <%= f.text_field :fqdn, disabled: @host.persisted? %> <% end %> <% if @host.persisted? %> <%= f.password_field :password, label: 'Token', value: @host.password %> <%= f.number_field :port, min: 1 %> <% end %> <% emails = (@host.users.pluck(:email) + @host.email_recipients).uniq.select(&:present?) %> <%= f.select :email_recipients, options_for_select(emails, @host.email_recipients), {}, multiple: true %>