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')%> > <td><%=h event.id %></td> <td><%=h event.sequence %></td> <td><%=h event.start_date.strftime(" %b %d %Y %H:%M") %></td> <td><%=h event.end_date.strftime("%b %d %Y %H:%M") %></td> <td><%=h event.instructor.full_name %></td> <td><%=link_to 'Show', object_url(event) %></td> <td><%=link_to 'Edit', edit_object_url(event) %></td> <td><%#=link_to 'Destroy', object_url(event), :method => :delete %>
<%= link_to_function "delete", "Modalbox.show('<h5>You are about to change a recurring class.<p> Do you want to change only this occurrence of the class, or this and all future occurrences?</p></h5> <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()\"></form>', {title: 'Changing a recurring class'});" %> </td> </tr> <% end %>