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.

submit_tag emits extra semicolon when no onclick options are provided

#388

The submit_tag in form_tag_helper allows for an 'onclick' option to be bassed as one of the options hash items. Currently, if there is no 'onclick' item in the options hash then the submit_tag includes an extra semicolon in the generated onclick string.

This is caused by the .join(';') on the array of options when one of the options ('onclick') in this case, is nil.

This patch removes nil items from the options array before calling .join(';').

So, if you use this in your view:

submit_tag("Save", :disable_with => "Saving...")

Before the patch, the output looks like this:

After the patch, the output looks like this:

Notice the extra semicolon in the before patch output around this area:

this.disabled=true;this.value='Saving...;';*;*result =

Reported by scott stewart · June 11th, 2008 @ 01:33 PM

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

Activity

  1. scott stewart
    scott stewart

    Here is the pastie of the before and after output:

    http://pastie.org/212929

    June 11th, 2008 @ 01:42 PM

  2. Repository
    Repository
    • State changed from new to resolved
    • Tag set to actionpack, helper, patch, tests

    (from [7378e237342443addb1691795ac9457250b6db1e]) Ensure proper output when submit_tag is used with :disabled_with. [#388 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 2nd, 2008 @ 02:43 AM

  3. Repository
    Repository

    (from [67d5ac93556dd62fe6d7721a154085f39c919035]) Ensure proper output when submit_tag is used with :disabled_with. [#388 state:resolved]

    Signed-off-by: Pratik Naik

    http://github.com/rails/rails/co...

    July 2nd, 2008 @ 02:43 AM