我如何组织这种逻辑

Help me please!!

I want to create editable data table. In top of the table will be a button "Add" that adds row to the table with javascript. And in each row should be butons(links) "Save" and "Delete".

How can i send post request to server?

SORRY FOR MY dullness..

In application.js I have a function like this

function AddElementsToPage(elements) {
/*elements - is array with name elements whose will be add to page*/    
this.add_row_to_data_table = function(obj,attributes,selector_table){
    last_row_of_table = selector_table.find('tbody tr').last();
    var new_row = "<tr><th scope='row'></th>";

    if ($.isEmptyObject(last_row_of_table.html()))
    {
        $.each(attributes, function(index, item){
            input_tag = "<input id=\""+obj+"_"+item+"\" name=\""+obj+"["+item+"]\" size=\"10\"  type=\"text\" />";
            new_row = new_row + "<td>"+input_tag+"</td>";
        })
        alert(new_row);
        selector_table.append(new_row+"</tr>");
    }else
    {
        alert("not empty");
    }

}

my controllers action new

def new
 @table_row = SchOfWorkInformation.new
respond_to do |format|
  format.js do
    render :action => 'new'
  end
end
end

My new.js file

var obj = new AddElementsToPage();

obj.add_row_to_data_table("sch_of_working",["date","hour"], $('.data_table'))

My index.haml

 = link_to content_tag('span', "Add" , :class=>"add"),   new_sch_of_work_information_path, :remote => true
 %table{:border=>"1", :class=>"data_table", :style=>"width:450px"}
    %thead
      %th{:style=>"width:5%;"} №
      %th{:style=>"width:10%;"} Date
      %th{:style=>"width:10%;text-align:center;"} schedule_code
      %th{:style=>"width:2%;",:class=>"transperent_right_border"} 
      %th{:style=>"width:2%;"} 
    %tbody
      %tr
        %th{:scope=>"row"}
        %td=@sch.date
        %td=@sch.schedule_code
        %td{:style=>"text-align:center"}= link_tag "save", sch_of_work_informations, #how can send post request in here 
        %td{:style=>"text-align:center"}

I think this is the kind of answer you would be looking at. Follow the tutorial from railscasts http://railscasts.com/episodes/196-nested-model-form-part-1 nested form and it should help you. Basically you would have an add row button and it would add in javascript the html row, you could even have a remove the row button. Once this is done just press the save button of the form to allow all change to be done.