-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The js result after upload does not get executed #12
Comments
I think I have the same issue...I have a remoti_response block in my create.js.erb file. I can see using firebug that the contents I get returned is valid js, but is is not being evaluated by the browser as if the dataType isnt set to script.. Im using remotipart master. Rails 3.0.9 and jquery-rails 1.0.19 |
Here is what my form submit looks like: Started POST "/account?id=1418" for 127.0.0.1 at 2011-12-10 12:02:57 +0100 |
I see nobody watches the issues on this project. I have the following code in the create/update js:
and in the _form partial I have this link added:
This works when I do not upload any file but fails when I do. |
laleshii What if you just put this into your create.js.erb: <%= remotipart_response do%> Does that then work? |
Yes that works properly. I downloaded the test application and tried to see what were the differences. From what I've seen it was only that I used "" wrappers and not ''. After I replaced everything I could it worked partially. It works now besides the above auto generated link which auto generates the code with "" wrappers. |
This is not a issue it's a bug in the way the result is rendered. You can try for yourself. Put this in a form response which uses remotiform for AJAX file upload and you will see the result only gets properly rendered you don't upload anything and the classic js response is used. |
Im working on demo project that will demonstrate the bug. Ill put it on github and share the url @laleshii if you attach a file does it then send a HTML request and a JS request if you dont? That is my problem. update: If I use my simple demo project then it works fine, however if I use it in a client project with over 30 gems then it is messing up, as if some other gem is conflicting. I hope @JangoSteve will look into this issue as well.. My demo project is here: github.com/bjensen/remotipart_bug and it works fine. I need to experiment by adding more gems to the project to see which gem is causing the conflict. |
I finally figured it out my issue! It was a conflict with wicked_pdf, once I removed that from my Gemfile things were running smoothly. I am not sure yet why this is the case but Ill keep digging. @laleshii are you using wicked_pdf in your project? What happens if you use my demo project? If your not using wicked_pdf and your still getting errors then maybe you should do as me and remove gems while testing if the functionality of remotipart works. |
@bjensen In my application, I can confirm the same issue you found and also that removing wicked_pdf resolves the issue. Too bad that I need wicked_pdf though, so I'm still working on finding a solution. |
Hi @bjensen , the issue is both wicked_pdf and remotipart override the render method in some way: wicked_pdf through alias_method_chain and remotipart overrides render through "module inheritance", thus one of the render doesnt get called: class A1
def meth
puts 'a1'
end
end
class A2
def meth
puts 'a2'
end
end
module B
def self.included(base)
base.class_eval do
alias_method_chain :meth, :feature
end
end
def meth_with_feature
puts 'b'
meth_without_feature
end
end
module C
def meth
puts 'c'
super
end
end
A1.send :include, B
A1.send :include, C
A2.send :include, C
A2.send :include, B
puts A1.new.meth
# b
# a1
puts A2.new.meth
# b
# a2 they dont talk to each other ... |
@thiagobrandam I tried your fork, but that is not fixing that issue for me. |
@bitboxer if you disable wicked_pdf and use the official remotipart gem, it does work, right? My fork works for me, so I don't know what could be happening, maybe there's some edge case I overlooked when I forked... |
No, I am not using wicked_pdf in my project. But I see the same problem @laleshii is reporting. I see the textarea, but the code is not executed. I think there are more problems with this than the problem with wicked :( . |
@bitboxer I see ... My guess is that there is another gem causing you trouble, I suggest you disable all your gems one by one and test remotipart each time until it works. |
Any news on this? The specs pass and it works fine in the example app. I'm guessing it's not remotipart. |
Closing the issue, let me know if it needs to be reopened. |
To anyone else still experiencing this issue with wicked_pdf, you may try switching to wisepdf. I recently switched to wisepdf and everything appears to work as it should now. |
Thank you!! I had this issue and removing wickedpdf resolved my issues as well. Has anyone got wickedpdf and remotipart working friendly and could elucidate on what needs to be done to do so? In the mean-time I will look into wisepdf. |
Hello,
I am using Rails 3.0.7 and remotipart 1.0.1 with jquery-rails 1.0.19 .
Everything works just fine but after the request gets submitted the result does not get executed. I get the result surrounded by:
<textarea data-type="text/javascript" response-code="200"> ... JS code ...</textarea>
which from what I've read on the home page would need to be executed but it's not.
Can you please guide me to debugging this issue?
Thank you,
Rares
The text was updated successfully, but these errors were encountered: