<%= form_for snmp_config , as: :snmp_config,method: (snmp_config.id.blank? ? "post" : "put"), html: { class: "form-horizontal" , role: "form"} do |f| %>
<% selected_resource = @snmp_config.associated_resources %> <%= render 'shared/resources_dropdown', field_id: 'snmp_resources', label_text: 'Devices / Device Tags / Network', placeholder: 'Type to select Devices / Device Tags / Network', input_name: 'snmp_config[associated_resources][]', resource_model: @snmp_config, selected_values: selected_resource, resource_types: 'network,device,tag', container_class: 'col-sm-10', label_class: 'col-sm-2 control-label', custom_class: 'snmp-config', dropdown_width: '100%', validation_data: { 'validation' => 'required', 'validation-error-msg-container' => '#snmp_resource-error' } %>
<%=f.label :ro_community, "RO Community*".html_safe, :class=>"col-sm-4 control-label"%>
<%= f.text_field :ro_community,:class=>"form-control", :placeholder=>"RO Community", :data => {validation: 'required'}%>
<%=f.label :rw_community, "RW Community*".html_safe, :class=>"col-sm-4 control-label"%>
<%= f.text_field :rw_community,:class=>"form-control", :placeholder=>"RW Community", :data => {validation: 'required'}%>
<%=f.label :server_ip, "Server IP*".html_safe, :class=>"col-sm-4 control-label"%>
<%= f.text_field :server_ip,:class=>"form-control ip-mask", :placeholder=>"Server IP", :data => {validation: 'required ip'}%>
<%=f.label :server_port, "Server Port*".html_safe, :class=>"col-sm-4 control-label"%>
<%= f.text_field :server_port,:class=>"form-control number-mask", :placeholder=>"Server Port", :data => {validation: 'required port number'}%>
<%=f.label :server_community, "Server Community*".html_safe, :class=>"col-sm-4 control-label"%>
<%= f.text_field :server_community,:class=>"form-control", :placeholder=>"Server Community", :data => {validation: 'required'}%>
<%=f.submit (f.object.new_record? ? "Create SNMP Configuration" : 'Update SNMP Configuration'),:class=>"btn btn-success create_network"%> <%= link_to "Cancel", snmp_configs_path, :class => "btn btn-primary" %>
<% end %>