No Plan.
choonkeat / attache-rails Goto Github PK
View Code? Open in Web Editor NEWintegrate your Rails app with a attache server
Home Page: https://github.com/choonkeat/attache
License: MIT License
integrate your Rails app with a attache server
Home Page: https://github.com/choonkeat/attache
License: MIT License
No Plan.
When navigating directly to the file upload page in a browser(copy and pasting the url) I get the correct page, with placeholder and upload progress bar etc, however, if I navigate to it from a link on my site there is no placeholder nor is there a progress bar on upload. This is resolved if I refresh the page.
It also works correctly if I remove turbolinks(to test - this isn't really an option for me).
I have tried adding the jquery-turbolinks gem but this doesn't seem to work either. I'm stumped as it seems to work fine in the demo...
Any ideas?
I am using attache with a rails app I'm developing, currently just for pictures but may add ability to upload other files in the future (probably just video and pdf).
I've been trying to implement clamby within my app to scan files before they are uploaded but couldn't get it to work as it can't find the file - then, after re-reading up on attache it dawned on me that files are uploaded directly to the attache server not main app, thus I'm thinking I'd need clamby set up on attache server rather than the main app? Or am I wrong with this?
Thanks,
Johnny.
The documentation recommends using AttacheRails.upgrade_fileinputs but that function doesn't exist in the code anymore.
Is there a way to strip exif data from images on upload using attache?
Just a quick check, are you using CoffeeScript for AttacheCORSUpload.js
? The code is so clean & beautiful and I think it is compiled from CoffeeScript.
I'm trying to migrate this project into a purely front-end solution, and I think it would be helpful if I can see the original coffee script.
I encountered a weird behavior.
I created users successfully without ATTACHE_SECRET_KEY but raised error with ATTACHE_SECRET_KEY.
Is there any idea about that?
I used this sample app.
Log
Started POST "/users" for 127.0.0.1 at 2017-08-14 22:01:10 +0900
Processing by UsersController#create as HTML
Parameters: {"utf8"=>"โ", "authenticity_token"=>"3CVO214mfj4ZdIGQYmTTtgaVkihlFM0V33lCJSBIA9l0kFinJ/GCNcEVRRe+IgXMxrqu23YdpBI9F9uRIouQMg==", "user"=>{"name"=>"fsadf", "photo"=>"{\"path\":\"38/44/4e/e0/d9/c6/66/c9/92/76/c2/e2/b5/3d/22/29/IMG_8204.JPG\",\"content_type\":\"image/jpeg\",\"geometry\":\"3024x4032\",\"bytes\":2110322}"}, "commit"=>"Create User"}
(0.1ms) begin transaction
SQL (0.5ms) INSERT INTO "users" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "fsadf"], ["created_at", "2017-08-14 13:01:10.743427"], ["updated_at", "2017-08-14 13:01:10.743427"]]
DEPRECATION WARNING: The behavior of `attribute_was` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `attribute_before_last_save` instead. (called from block in create at /Users/willnet/tmp/attache-sample/app/controllers/users_controller.rb:29)
DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead. (called from block in create at /Users/willnet/tmp/attache-sample/app/controllers/users_controller.rb:29)
(0.6ms) commit transaction
Redirected to http://localhost:3000/users/8
Completed 302 Found in 5ms (ActiveRecord: 1.2ms)
Started GET "/users/8" for 127.0.0.1 at 2017-08-14 22:01:10 +0900
Processing by UsersController#show as HTML
Parameters: {"id"=>"8"}
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 8], ["LIMIT", 1]]
Rendering users/show.html.erb within layouts/application
Rendered users/show.html.erb within layouts/application (3.6ms)
Completed 500 Internal Server Error in 10ms (ActiveRecord: 0.2ms)
ActionView::Template::Error (nil is not a valid asset source):
7:
8: <p>
9: <strong>Photo:</strong>
10: <%= image_tag @user.photo_url('100x100#') %>
11: </p>
12:
13: <%= link_to 'Edit', edit_user_path(@user) %> |
app/views/users/show.html.erb:10:in `_app_views_users_show_html_erb__4590579243624848200_70348149155540'
Should the placeholder picture and progress bar work by default if I install this gem? I ask as I have installed it and cannot seem to get the placeholder picture to show nor the progress bar (uploads work, but not the above). Any pointers as to how this can be acheived?
Is there a method to exclude/include certain file types for upload?
ie disallow upload of pdf or gif etc
I'm sure I saw somewhere with details on how to do this with attache - but for the life of me i can now no longer find it?
thanks,
Johnny
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.