Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

unobstructive Delete action links are not working in IE7

#6312
  • Rails 3.0.1
  • IE 7.0.537x
  • Prototype version 1.7
  • Windows XP

The delete link actions are throwing "Error: Object doesn't support this property or method". The click is firing and forwarding the taking the user to the show page.


<a href="/controller/id" data-confirm="Are you sure?" data-method="delete" rel="nofollow">Delete</a>

rails.js line 110 appears to be the cause

element.parentNode.insert(form);

untested fix: replacing the .insert(form) call with .appendChild(form) seems to work.

The appendChild() call was substituted with insert() in a recent commit:
https://github.com/rails/rails/commit/f61d923d284062b4e4864d81c6031...

Reported by Tamer Salama · January 18th, 2011 @ 11:05 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Matthijs Langenberg
    Matthijs Langenberg
    • Tag changed from javascript, prototype.js, rails3.0.1, unobtrusive to javascript, prototype.js, rails3.0.1, rails3.0.3, unobtrusive

    I also ran into this issue.

    The problem is that element.parentNode is a DOM function, so it does not guarantee to return an element that is already extended by the Prototype library. It is better to use element.up(). So if you change line 110 from element.parentNode.insert(form) to element.up().insert(form), you are good to go.

    It seems to be solved at https://github.com/rails/prototype-ujs/commit/9d5aa75eee9b39818bddf... in a similar way.

    This is already fixed in the current master.

    January 21st, 2011 @ 09:56 AM

  2. rails
    rails
    • Tag changed from javascript, prototype.js, rails3.0.1, rails3.0.3, unobtrusive to javascript, prototypejs, rails301, rails303, unobtrusive
    • State changed from new to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    April 22nd, 2011 @ 01:00 AM

  3. rails
    rails
    • State changed from open to stale

    April 22nd, 2011 @ 01:00 AM