Conversation
|
Can you kill http://github.com/NickClark/jquery-ujs/commit/254d5f5f7a553904d7d4841e4532d05a620c697f . Also please merge http://github.com/NickClark/jquery-ujs/commit/c6f00a10de753c1fb58a9f187460666c4d52835c and http://github.com/NickClark/jquery-ujs/commit/71ff00b85ac457ec2e3b9262e7a2de7fb5426b53 into a single commit. If possible add a test. You can look at existing set of tests to get an idea on how to write them. Let me know if you have any question. |
|
Also part of this commit: bundler complains about a source, so I added one. |
|
Rather than passing Also here callRemote: function (button) , the variable name is button. But it could be button or any input element. I would suggest that let's make it generic. Pseuedo code is here. Let me know your thoughts. Notice that in your test you are attaching an input element and not a button. That's the main reason why I want to avoid calling variable 'button'. Thanks. |
|
If you are having any difficulty with existing pull request then create a new one. Also if you are creating a new pull request then please split commit related to gemfile in a different commit. Thanks |
|
I should have a fix this week. Actually, I thought I had it fixed this evening (maybe still do) but all of a sudden I can't get the test suite to pass, on my fork, nor on a fresh clone of the project. Ill update the pull request once I get the tests passing. |
|
If you need any help then lemme know. |
|
Nick, good job. I forked this project specifically to add this feature, I'm glad someone else has thought of this. |
|
This should be it. Let me know if there is something else you notice or think should be done. Im glad you caught the button vs input issue, I hadn't though of that. |
|
On a quick glance code looks good to me. I will dig deep into code today or tomorrow and will provide feedback. Thank you. |
|
Can you rebase your code against master. Master has changed a lot in the last 2/3 days. Thanks. |
|
Done! I must say, Iam amazed at githubs ability to track a pull request. Despite all the changes from me doing forced push's and the commit hash changing, it always updates this pull request properly. |
|
Just want to let you know that the tests you wrote pass for jQuery 1.4.4 but they fail for jQuery 1.4.3 . If you run the test then at the top you will see link for 1.4.3 click on that and you will see the failure. Fix is easy and I am applying that. |
|
Actually your test is failing only on Firefox for jQuery 1.4.3 and that also randomly. I will have to look closely what's going on. |
|
Thanks for catching that. I was aware that I could test the different versions and looking at it again in my browsers doesn't show a failure. Which browser did it fail for you in? |
|
If I fix the test for jQuery 1.4.3 in FF then it fails for jQuery 1.4.4 in FF. Not sure what's so special about FF. Tests work fine in chrome. Will come back to this this issue in a couple of days. If you can find more info then do share. Thanks |
|
It is failing for Firefox with jQuery 1.4.3 . |
|
I am closing this ticket since the tests are still failing for me. I would suggest to split the functionality in two different pull requests. In the first scenario lets just handle two submit buttons. In the next iteration we will worry about buttons. Hopefully when we take incremental steps then we can make tests pass. Since new pull requests will be made I am closing this ticket. |
|
Hello Neeraj and Nick, I know this is an old, closed request, but I'm running into the same issue that Nick was trying to fix -- I have a form_for :remote, using jquery-rails, with multiple submit buttons, and it doesn't work. Is there any plan to fix this? Thanks! |
|
I will take a look over the weekend. Or may be Steve can reply before I have a chance. |
|
Thanks Neeraj! For now I've hacked my local copy using Nick Clark's Cheers, On Thu, May 12, 2011 at 3:51 PM, neerajdotname
|
|
Before you know it Steve will have an answer. He is on it. :-) |
|
Hey guys, sorry I've gotten really backed up this week. I'll be able to take a look at this this weekend I think. Is there any chance you can open a new issue linking to this one, just so I don't forget? |
|
Actually are you guys hoping some form of the code in this pull request will get pulled in, or are you hoping for a new take on the problem, which may be easier with the new code-base? If the former, we can just re-open this pull request. If the latter, then maybe we can open that new ticket. |
|
HI Steve, I don't have any need for the code in the pull request to get pulled in, I just need multiple submit buttons in an ajax form to be differentiable inside the controller actions they invoke. I will open a new issue. |
|
I created a new issue: https://rails.lighthouseapp.com/projects/8994/tickets/6001 |
I have modified the form submission function
callRemoteto allow a button to be passed in and be submitted with the form data. I also added the a live event call that adds a 'click' event handler to each submit button in a form, passing tocallRemotethat button as an argument. The submit event has been left intact. Only one or the other should fire since the event is kept from bubbling up. I have not had time to write a test and also am not familiar with the test framework.