image_submit_tag doesn't support :disable_with option #2013

Closed
jaylevitt opened this Issue Jul 8, 2011 · 9 comments

Projects

None yet

6 participants

@jaylevitt

The submit_tag helper has a :disable_with option that creates the data-disable-with attribute used by rails-ujs. The data-disable-attribute works with image submit tags as well, but image_submit_tag has no such helper; the only way to create the attribute is the ugly and inconsistent :"data-disable-with"option. Can :disable_with be added to image_submit_tag?

@aratak
aratak commented Jul 9, 2011

What do you think, when I've added :disable_with for image_tag what should be happened?

Something like this?

  image_submit_tag "submit.png", :disable_with => "another_submit.png"

btw, in this case we will have some delay before downloading new image.

@dmitriy-kiriyenko

Obviously +1.
image_submit_tag is just another way to create an submit_tag. It should be compatible with regular submit_tag api.

@jaylevitt

I don't think we need the ability to :disable_with an image (especially if, as you point out, you'd have to go download the image - which might not even appear, since we're already waiting for the server). I'm just asking for the ability to do the auto-disable cleanly; I'm not asking for any visual feedback.

@aratak
aratak commented Jul 9, 2011

The most correctly way to do live changing of image witout request delay - css sprite.
This way could not be "standart". So imho :disable_with => "another_submit.png" is most correctly way.

But I think, :disable_with => "another_submit.png" could not be useful, because you will use css sprite.

I'm confused :)

I sugest to use custom form builder to define new behaviour for f.submit

@isaacsanders

@jaylevitt Is this still an issue?

@jaylevitt

Still an issue, but @nashby, would you say this is now a dup of #5740 or should both stay open till the decision is made?

@nashby
nashby commented Apr 29, 2012

@jaylevitt as you can see

I asked to the guys about this pull request and we agreed that we should remove this options either from submit_tag and image_submit_tag

So I think we need @rafaelfranca here for more details about that decision.

@rafaelfranca
Member

Yeah. We need to remove :disable_with and :confirm from these helpers. Let leave both open so we can remember about this decision.

Also, if it was marked with the label actionview I already revised it and it is still valid. These are issues that I will work later. But if someone want to work too feel free. I'll appreciate it

@rafaelfranca
Member

We removed this option on the master branch. 683fc4d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment