s3_multipart icon indicating copy to clipboard operation
s3_multipart copied to clipboard

Helpers methods not available

Open joseluistorres opened this issue 9 years ago • 6 comments

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 avatar Feb 27 '15 16:02 joseluistorres

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.

joseluistorres avatar Mar 04 '15 15:03 joseluistorres

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 avatar Aug 26 '15 22:08 michaelkeenan

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 avatar Aug 27 '15 03:08 michaelkeenan

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 avatar Aug 27 '15 13:08 joseluistorres

it worked for me too! :+1: :dancers: thanks @michaelkeenan!

joseluistorres avatar Aug 27 '15 13:08 joseluistorres

You're welcome! :)

michaelkeenan avatar Aug 27 '15 16:08 michaelkeenan