Delete once / all future occurrences from a JavaScript window

I am trying to do something similar to ical delete events you can
delete just the current event or all future occurrences

i am currently using a JavaScript window called modalbox which let me
write pure html into it

  1. is there a way to create a delete form manually ? what i have in
    mind is 2 different params that i’ll process in my controller
    according to the button that was clicked just like i already have in
    my edit page (which is working)

  2. any other idea how this functionality can be accomplished?

here’s my code:
<%- @events.each do |event|%>
<tr class=<%= cycle(‘odd’, ‘even’)%> >

<%=h %> <%=h event.sequence %> <%=h event.start_date.strftime(" %b %d %Y %H:%M") %> <%=h event.end_date.strftime("%b %d %Y %H:%M") %> <%=h event.instructor.full_name %> <%=link_to 'Show', object_url(event) %> <%=link_to 'Edit', edit_object_url(event) %> <%#=link_to 'Destroy', object_url(event), :method => :delete %>

<%= link_to_function “delete”,

You are about to change a recurring class.

you want to change only this occurrence of the class, or this and all
future occurrences?

<input name=“commit” type=“submit”
value=“Only This Class” /> <input name=“change_all_future” type=
“submit” value=“All Future Classes”/> <input type=“button”/
value=“Cancel” onclick=“Modalbox.hide()”>’, {title:
‘Changing a recurring class’});” %> <% end %>