RoR: Destroy option in form

48 views Asked by At

I have tried to put a dynamic field in my App to add new fields if the user need to put more information, but since i got no success im trying to get around, one that i maybe have found is a check box to distroy the field.

Well this is my view in _form.html.erb

<tbody name="bodao" class="jqueryform" id="bodao">
<tr class="tr" id="tr">
<td name="projetoid" class="projetoid" id="projetoid"> <%= f.grouped_collection_select :projeto_id, Cliente.order(:name), :projetos, :name, :id, :name, prompt: "Selecionar" %>  </td>
<td name="raiz" class="raiz" id="raiz">     <%= f.number_field :seq%>     </td>
<td name="seqpai" class="seqpai" id="seqpai">  <%= f.number_field :seqpai %>  </td>
<td name="descr" class="descr" id="descr">    <%= f.text_field :descr %> </td>

<td name="hour" id="hour" class="hour">    <%= f.number_field :hour %>   </td>
<td name="typo" id="typo" class="typo">   <%= f.select("typo", {"Analitica" => "Analitica", "Sintetica" => "Sintetica"}) %> </td>
<td><%= f.check_box :_destroy %></td>
 </tr>
 </tbody>

I dunno if this is possible, but i'm trying to put many of this code in my view and a check box where if marked the APP will ignore those fields and won't save in the database.

Testing it the way it looks, nothing works, cant POST due 500 internal server error.

Full _form code http://pastebin.com/c1CRQ2wJ

Firebug Post: http://pastebin.com/3KyT3EX1

0

There are 0 answers