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

Helpers methods not available #36

Open
joseluistorres opened this issue Feb 27, 2015 · 6 comments
Open

Helpers methods not available #36

joseluistorres opened this issue Feb 27, 2015 · 6 comments

Comments

@joseluistorres
Copy link

Hi there,

I'm currently testing the s3_multipart implementation in our app but after following all the steps now I can't get any of our (Module) helpers to work, none of them is available, is there something special I need to do to include the helpers again?

Thanks

Rails 4.1.8
Ruby 2.1.1
s3_multipart 0.0.10.6

@joseluistorres
Copy link
Author

I had to explicitly call the helpers I need from ApplicationController to make it work:

    helper :bootstrap_flash
    helper :location

I also forked the repo to custom the S3 path I'm writing to and make the input file match our needs and also I added a class to customize the downloadable URL with a expiring token from AWS.
https://github.com/joseluistorres/s3_multipart not sure those changes fits everyone needs.

@michaelkeenan
Copy link

I've encountered this too. A few days ago, I added the Spree gem to my app. It couldn't find methods from its frontend_helper. It's been very difficult to track this down, but I eventually isolated it to the inclusion of the s3_multipart gem. When s3_multipart is included, it breaks Spree; when it's not, Spree is fine.

I'm having trouble figuring out what s3_multipart is doing to break helpers, though. Jose, did you ever find that out? I could also remove s3_multipart from my app, but I'd prefer not to (I include it as a backup option for my users if they have trouble with FineUploader).

@michaelkeenan
Copy link

I've figured this out, mostly. s3_multipart generates a file: /app/uploaders/multipart/[object]_uploader.rb

This file's first line will be:

class ItemUploader < ApplicationController

It's this line, or this class being created in this way, that breaks the helpers. If you change it to this, the helpers work, and s3_multipart still works:

class ItemUploader < ActionController::Base

I don't know exactly why this works, but it seems to work.

michaelkeenan added a commit to michaelkeenan/s3_multipart that referenced this issue Aug 27, 2015
…ontroller

Being subclassed from ApplicationController caused some helper methods to not work. (See maxgillett#36)
@joseluistorres
Copy link
Author

Oh @michaelkeenan sorry for delay, no I couldn' figure it out I had to manually add each helper to make it work, I'll try your workaround

@joseluistorres
Copy link
Author

it worked for me too! 👍 👯 thanks @michaelkeenan!

@michaelkeenan
Copy link

You're welcome! :)

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

2 participants