# Delete once / all future occurrences from a JavaScript window

**URL:** <https://www.ruby-forum.com/t/delete-once-all-future-occurrences-from-a-javascript-window/153371>\
**Category:** Rails\
**Created:** [November 15, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/delete-once-all-future-occurrences-from-a-javascript-window/153371 "2008-11-15T21:47:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ami](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@ami](https://www.ruby-forum.com/u/ami)\
**Post date:** [November 15, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/delete-once-all-future-occurrences-from-a-javascript-window/153371/1 "2008-11-15T21:47:51Z")

</div>

Hi  
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 event.id %\> \<%=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”,  
“Modalbox.show(‘

##### You are about to change a recurring class.

Do  
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 %\>
