i having problem in how remove value drop down list after submitting form. have route model contains :route_name
, :no_of_stop
, , :vehicle_id
attributes. example, vehicle_id
's 1, 2, 3. if selected 1 while submitting form, won't display in other entry. i.e vehicle_id
's 2,3 likewise..
in view
<%= simple_form_for(@route, html: {class: 'form-inline form-horizontal'}, :validate => true) |f|%> <p><font color="red">fields * required.</font></p> <%= f.input :route_name %> <%= f.input :no_of_stop, as: 'string' %> <div class="control-group string optional route_vehicle_id"> <label class="string optional control-label" for="vehicle_id">vehicle code</label> <div class="controls"> <%= f.select :vehicle_id, vehicle_list, {} , {class: 'input-mini add-margin' } %> </div> </div> <div class="form-actions"> <%= button_tag(type: 'submit', class: "btn btn-primary") %> <i class="icon-ok icon-white"></i> save <% end %> </div> <% end %>
if understand correctly allocation vehicles. if allocate vehicle 1, in next form presentation, have vehicle 2 , 3 available, right?
if so, when populate vehicle_list
variable, introduce condition not select vehicles allocated.