Skip to content
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

conflict with gem jquery-fileupload-rails #69

Closed
raykin opened this issue Mar 20, 2013 · 10 comments
Closed

conflict with gem jquery-fileupload-rails #69

raykin opened this issue Mar 20, 2013 · 10 comments

Comments

@raykin
Copy link

raykin commented Mar 20, 2013

when I include gem jquery-fileupload-rails and use its middleware, my server response becomes

<!DOCTYPE html><html>
<body><textarea data-status='200' data-statusText='OK' data-type='text/html'>
<textarea data-type="text/javascript" response-code="200">
...lines of jquery code...
 </textarea>
</textarea></body></html>

then the js code was not evalutated.
jquery-fileupload-rails middleware wrap a new textarea tag which generated by https://github.com/tors/jquery-fileupload-rails/blob/master/lib/jquery/fileupload/rails/middleware.rb#L25
and broken remotipart.
I don't think it's a problem of remotipart. and I create the issue to help other guys who blocked on this problem and it should be closed later.
But I curious why set response.content_type = Mime::HTML in https://github.com/JangoSteve/remotipart/blob/master/lib/remotipart/render_overrides.rb#L17

@maletor
Copy link

maletor commented May 30, 2013

I have run into this same issue. How did you resolve?

@raykin
Copy link
Author

raykin commented May 31, 2013

run rake middleware and make sure JQuery::FileUpload::Rails::Middleware was not existed. If it existed, you may defined it in your config files or in your gems. ex, in my app, it was used by another gem s3_direct_upload, so I replace it with another one.

@maletor
Copy link

maletor commented May 31, 2013

Got it. So I did that and things work great with remotipart again now. The
problem lies with IE8 and s3_direct_upload. It does not seem to upload with
IE but works with Chrome.

On Thursday, May 30, 2013, raykin wrote:

run rake middleware and make sure JQuery::FileUpload::Rails::Middleware
was not existed. If it existed, you may defined it in your config files or
in your gems. ex, in my app, it was used by another gem s3_direct_upload,
so I replace it with another one.


Reply to this email directly or view it on GitHubhttps://github.com//issues/69#issuecomment-18720249
.

@joselo
Copy link

joselo commented Jun 14, 2013

@raykin I have the same problem, you mean that should I replace s3_direct_upload with other gem?

@raykin
Copy link
Author

raykin commented Jun 14, 2013

@joselo not example, in my usage, I only need part feature of s3_direct_upload, so I extract the needed part in my own project. I thought you can fork s3_direct_upload and remove Rails.application.config.middleware.use JQuery::FileUpload::Rails::Middleware

@joselo
Copy link

joselo commented Jun 14, 2013

@raykin ok thank so much!!

@joselo
Copy link

joselo commented Jun 26, 2013

instead of make a fork of s3_direct_upload I created a initializer that removes the middleware and s3_direct_upload still works, thanks for the advice.

App::Application.config.middleware.delete "JQuery::FileUpload::Rails::Middleware"

@maletor
Copy link

maletor commented Aug 5, 2013

@JangoSteve
Copy link
Owner

@maletor Remotipart uses this jquery.iframe-transport.js.

@maletor
Copy link

maletor commented Aug 5, 2013

Darn.

On Mon, Aug 5, 2013 at 12:43 PM, Steve Schwartz notifications@github.comwrote:

@maletor https://github.com/maletor Remotipart uses this
jquery.iframe-transport.jshttps://github.com/cmlenz/jquery-iframe-transport/blob/master/jquery.iframe-transport.js
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/69#issuecomment-22135326
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants