batter / s3_cors_fileupload

A gem for Rails to allow for uploading of files to AWS-S3 via CORS using the jQuery-File-Upload
MIT License
21 stars 9 forks source link

Move form template from helper into the generator #1

Open ryanwood opened 11 years ago

ryanwood commented 11 years ago

I'm using Bootstrap 3. The way you have the html embedded in the form helper makes it impossible to to change the markup but take advantage of the policy and form helpers. Since you are already generating a number of views, why not generate the form view so the markup can be changed/updated?

batter commented 11 years ago

I made the form helper provide a singular tag helper to the view because I thought it would simplify the work for others and due to the nature of the dynamic values that need to be put into the fields in order to make the uploads to S3 work. That being said, you can still use the PolicyHelper class outside the context of the FormHelper module to construct your own form syntax if you desire.

The s3_cors_fileupload_form_tag helper accepts a block argument so that you can append additional fields or html into the form area if desired as well. What exactly are you trying to accomplish?

ryanwood commented 11 years ago

Primarily I needed to update the form markup to work with Bootstrap 3.0. It only needed minor adjustments. Hard to warrant building out my own form for that. Thanks for the follow up.

batter commented 11 years ago

Has the syntax for the form changed on the trunk of the jQuery-File-Upload project? If so, I'll just pull in the most recent changes (which I'd think would work with Bootstrap 3.0). Or if you have a pull request showing how you think this could work in a way that would make it more flexible, I'm happy to take a look at that as well. Perhaps it makes sense to offer an option for syntax for Bootstrap 3.0 vs. 2.0 for the form syntax? I don't know much about the differences as I only use bootstrap in my projects for this javascript for the most part.

I've been meaning to give this project more attention but have been pretty busy trying to focus on releasing PaperTrail 3.0.

ryanwood commented 11 years ago

To be honest, I ended up using another gem for this purpose (https://github.com/waynehoover/s3_direct_upload) so I'm not going to have the time to do a PR on this gem.

Bootstrap changed class name in their grid from using span-12 to col-md-12. They also changed icon from images to a font. it just seems that any markup/view should be templated to accommodate changes like this. Ideally, you shouldn't have to rewrite Ruby methods to change the name of a class, IMHO.

On Tuesday, September 3, 2013 at 9:52 AM, Ben Atkins wrote:

Has the syntax for the form changed on the trunk of the jQuery-File-Upload (https://github.com/blueimp/jQuery-File-Upload) project? If so, I'll just pull in the most recent changes (which I'd think would work with Bootstrap 3.0). Or if you have a pull request showing how you think this could work in a way that would make it more flexible, I'm happy to take a look at that as well. Perhaps it makes sense to offer an option for syntax for Bootstrap 3.0 vs. 2.0 for the form syntax? I don't know much about the differences as I only use bootstrap in my projects for this javascript for the most part.

— Reply to this email directly or view it on GitHub (https://github.com/fullbridge-batkins/s3_cors_fileupload/issues/1#issuecomment-23713770).