This project is archived and is in readonly mode.
button_to_remote aliases submit_to_remote
-
Michael Koziarski
- Assigned user set to Michael Koziarski
- Tag changed from actionpack, actionview, helper, patch, prototype to actionpack, actionview, enhancement, helper, patch, prototype, tiny
-
DHH
- State changed from new to committed
-
Tarmo Tänav
Hey everyone,
Looks like there was a conflict between this change and one added later : http://github.com/rails/rails/co... (ignore the fact that said commit does nothing because the commit introduced by this ticket, albeit earlier, overrides all methods added by it).
My question is, why should button_to_remote use submit_to_remote style API when it could easily use link_to_remote style and thus become (by default) usable without a containing form?
Is there any benefit to keeping submit_to_remote and button_to_remote as aliases instead of separating button_to_remote to be something like link_to_remote and submit_to_remote as a specialization of that button_to_remote which applies the :with => "Form.serialize(this.form)" and :name => name options?
-
Michael Koziarski
- State changed from resolved to open
- Milestone cleared.
Let's make sure we have a nice api before we cut the 2.2 release.
-
Clemens Kofler
Tarmo,
on the Pro side I see the benefits of the change you're suggesting because it makes plenty of sense. Personally, I wouldn't have implemented submit_to_remote as it is in the first place but I guess we're touching some really old Rails code base here.
On the other hand, the reason why I originally opened this ticket was because of the inconsistency. Back then, I was surprised to find that link_to had its counterpart link_to_remote whereas button_to didn't have one - at least not by name. Making button_to_remote behave totally different than button_to might lead to some amount of confusion. Moreover, without a containing form, the button wouldn't degrade gracefully with JS turned off. I'm not sure if the current solution degrades gracefully but that's certainly a downpoint.
In short: I have a hard time deciding which I find makes more sense - so I guess this is up to you guys!
-
Michael Koziarski
- Assigned user changed from Michael Koziarski to Pratik
Moving this to pratik as I may be on holiday during the RC
-
DHH
- Assigned user changed from Pratik to Tarmo Tänav
I'm +1 on making button_to_remote work like link_to_remote and keeping submit_to_remote as it always was.
-
Michael Koziarski
Does this do it:
-
Pratik
- State changed from open to resolved
