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.

There was a problem

You must be a member of this account.

This project is archived and is in readonly mode.

Prototype helpers should generate Element.insert instead of Insertion.new

#540

I have updated the code of a patch i did time ago:

http://dev.rubyonrails.org/ticke...

Rails prototype helpers should generate Element.insert instead of Insertion.new because this has been deprecated in Prototype 1.6 as explained in the old ticket.

More information about this can be found in:

http://www.prototypejs.org/api/i...

Reported by Emilio Tagua · July 2nd, 2008 @ 10:25 PM

State: resolved
Milestone: 2.1.3
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: Low

Activity

  1. Emilio Tagua
    Emilio Tagua
    • Assigned user set to DHH

    July 3rd, 2008 @ 10:22 PM

  2. Emilio Tagua
  3. Emilio Tagua
    Emilio Tagua

    Third time updating the patch so it can be merged...

    Any comments?

    July 22nd, 2008 @ 03:24 PM

  4. Pratik
    Pratik
    • Assigned user changed from DHH to Pratik

    July 29th, 2008 @ 09:07 PM

  5. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to open
    • Milestone changed from 2.x to 2.1.1

    July 29th, 2008 @ 09:54 PM

  6. Mislav
    Mislav

    +1

    There is a typo in RDoc: missing opening double quote here:

    new Element.insert("list", { bottom: <li>Some item</li>" });
    

    The patch seems a bit large and certain parts very hackish. Still, I haven't had time to actually study RJS code in depth. Are you sure this is in its simplest form?

    August 5th, 2008 @ 06:43 PM

  7. Emilio Tagua
    Emilio Tagua

    Mislav, thanks for your feedback.

    I have fixed the typo in docrails:

    http://github.com/lifo/docrails/...

    About the patch being large, i don't quite agree, i did have to change tests to match the new output and update docs.

    I do agree selector_assertions is a very hackish helper, as it was before the patch. I'll try to work on it and create a new ticket with the results.

    Thanks again for you comments.

    August 6th, 2008 @ 02:26 PM

  8. Emilio Tagua
    Emilio Tagua

    I've improved selector_assertion by: - Making use of constants that were defined but never used. - Improving the readability of the code. - Adding test to untested code. - Simplifying Regexps.

    This second patch applies on the current version, that would be after the first patch of this ticket was commited.

    Anyway, the former patch works well and the later one is just and improvement to code that was already in.

    August 7th, 2008 @ 05:33 PM

  9. Mislav
    Mislav

    The code is a bit shorter, nicer, and adds a missing test.

    +1 from me

    August 7th, 2008 @ 05:58 PM

  10. Pratik
  11. Repository
    Repository
    • State changed from open to resolved

    (from [11eb29f60ab79caf22f7ca715500e32d9a1b03a2]) Make assert_select_rjs code more readable, make use of unused constants and use more simple Regexps.

    [#540 Prototype helpers should generate Element.insert instead of Insertion.new state:resolved]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    August 30th, 2008 @ 02:06 AM

  12. Jeremy Kemper
    Jeremy Kemper
    • State changed from resolved to open

    This caused a regression that wasn't covered by a test case.

    http://github.com/dchelimsky/rai...

    September 6th, 2008 @ 11:46 PM

  13. Emilio Tagua
    Emilio Tagua

    I have ran the test against the branches 2-1-stable and 2-0-stable (before any of these patches were commited), and the test fails on both, i can't see either were the previous code verified the double insertion to raise any error.

    By the way, should an error be raised in that situation?

    September 8th, 2008 @ 04:44 PM

  14. Pratik
    Pratik
    • Assigned user changed from Pratik to Jeremy Kemper

    October 4th, 2008 @ 03:09 PM

  15. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.1.1 to 2.1.3

    October 24th, 2008 @ 03:19 AM

  16. Repository
    Repository
    • State changed from open to resolved

    (from [dce0da77e7ef602f7420f43c0d1aba5a99a00bdb]) Fix assert_select_rjs not checking id for inserts [#540 Prototype helpers should generate Element.insert instead of Insertion.new state:resolved] http://github.com/rails/rails/co...

    December 26th, 2008 @ 09:57 PM