I need the opposite to this peice of code:
if( $('#effort_<%= @project_task.id %>').length == 0 )
$('#task_list').append('<tr><td><%= @project_task.project.project_number %> <%= @project_task.project.project_name %> - <%= @project_task.task_name %></td>' +
'<td><%= text_field :effort, :hours, :name => 'effort_' + @project_task.id.to_s, :id => 'effort_' + @project_task.id.to_s %></td>' +
'<td><%= link_to image_tag('icons/delete.png'), :method => :destroy, :remote => true %></td></tr>' );
$('#effort_<%= @project_task.id.to_s %>').change( function() { submiteffort( this, <%= @project_task.id.to_s %>); } );
when the user clicks the delete button it needs to delete that row of the table.
I know you can use .remove() but im not sure how to use this since im new to RoR.
You can do something like this:
Make sure you use
closest.parentswill return all the ancestortrs so it might remove more nodes than needed if you have nested tables.closestis the safest option.