Forum: Ruby on Rails delete once / all future occurrences from a JavaScript window

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F9bdba6e1c8a28664e99e9c8caaa05bd?d=identicon&s=25 Ami (Guest)
on 2008-11-15 21:47
(Received via mailing list)
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 %>
This topic is locked and can not be replied to.