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.

[patch] image_tag doesn't allow :escape => false option anymore

#2878

image_tag used to allow the caller to specify :escape => false option to avoid escaping its attribute values. The current implementation simply invokes tag() without honoring the :escape option anymore.

Reported by tsailipu · July 6th, 2009 @ 10:32 PM

State: resolved
Milestone: 3.x
Assigned to: Rizwan Reza Rizwan Reza
Importance: none

Activity

  1. mdeering
    mdeering
    • Tag set to actionview, bugmash, image_tag

    I just ran into this. This seems pretty clear cut to fix.

    tag parameters

    tag(name, options = nil, open = false, escape = true)

    But when called from image_tag is just called like so

    tag("img", options)

    Should be able to change the call inside of image_tag over to?

    tag("img", options, false, options.delete(:escape))

    I have never contributed to Rails so give me some time to poke around find the procedures.

    September 24th, 2009 @ 05:44 AM

  2. mdeering
    mdeering

    Attaching the patch to fix/allow the escape option to work with image_tag

    September 24th, 2009 @ 07:13 AM

  3. mdeering
    mdeering
    • Tag changed from actionview, bugmash, image_tag to actionview, bugmash, image_tag, patch

    Adding the patch tag as per the contributers guide.

    September 24th, 2009 @ 07:36 AM

  4. Elad Meidar
    Elad Meidar

    -1 Patch did not apply on 2-3-stable.

    September 25th, 2009 @ 06:15 AM

  5. mdeering
    mdeering

    Patch was against Edge Rails. I will do one up quickly for 2-3-stable if that is what is needed.

    September 25th, 2009 @ 06:23 AM

  6. Elad Meidar
  7. Elad Meidar
    Elad Meidar

    i am pretty sure you need to patch both... but there you have it anyway..

    September 25th, 2009 @ 06:36 AM

  8. Matías Flores
    Matías Flores

    verified the wrong behavior in both master and 2-3-stable
    +1 both patches applies cleanly and fix the issue

    September 27th, 2009 @ 07:57 PM

  9. mdeering
    mdeering
    • Title changed from image_tag doesn't allow :escape => false option anymore to [patch] image_tag doesn't allow :escape => false option anymore

    Adding patch to the title. Really not sure what else is needed to get movement or feedback. Tried to posting to IRC a few times with no luck.

    October 1st, 2009 @ 05:30 AM

  10. Elad Meidar
    Elad Meidar

    Maybe a "review" tag is going to help, but i am not sure.

    October 1st, 2009 @ 05:41 AM

  11. Rizwan Reza
    Rizwan Reza
    • Tag changed from actionview, bugmash, image_tag, patch to actionview, image_tag, patch

    February 12th, 2010 @ 12:46 PM

  12. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  13. Rizwan Reza
    Rizwan Reza
    • Tag changed from actionview, image_tag, patch to actionview, bugmash, image_tag, patch
    • State changed from new to open

    Do we still need this?

    May 16th, 2010 @ 03:54 AM

  14. Neeraj Singh
    Neeraj Singh

    This is not an issue with rails3.

    Just specify :alt => nil and image tag will not have 'alt' attribute.

    May 16th, 2010 @ 04:20 AM

  15. Rizwan Reza
    Rizwan Reza
    • Tag changed from actionview, bugmash, image_tag, patch to actionview, image_tag, patch
    • State changed from open to resolved

    May 16th, 2010 @ 04:12 PM

  16. tsailipu
    tsailipu

    HI, Neeraj and Rizwan, how is this Neeraj's response related to the :escape => false option that this bug is about?

    May 16th, 2010 @ 06:25 PM

  17. tsailipu
    tsailipu
    • Assigned user set to Rizwan Reza

    May 16th, 2010 @ 06:30 PM

  18. Neeraj Singh
    Neeraj Singh

    @tsailipu I misread the question. The question was about escaping of attributes and I got it wrong. Sorry about that.

    May 16th, 2010 @ 08:03 PM