I have a Rails application with a list of potential customers in a table. In one of the columns, I show the status of the output in the drop-down menu. I want to enable the change of this state of the master when changing the value selected in the drop-down list.
This is what I tried:
Code for displaying the form in a table cell:
<% @leads.each do |lead| %> <tr> <td><%= lead.id %></td> <td><%= form_for(lead,:url => 'update_lead_status') do |f| %> <div class="field"> <%= f.select :status, ["to_call","called","confirmed","lite"], :selected => lead.status, onchange: "this.form.submit();" %> </div> <% end %> </td>
my update_lead_status method in the output controller:
I also want the view to be an Ajax style without updating.
source share