Coder Social home page Coder Social logo

choonkeat / attache-rails Goto Github PK

View Code? Open in Web Editor NEW
48.0 48.0 4.0 177 KB

integrate your Rails app with a attache server

Home Page: https://github.com/choonkeat/attache

License: MIT License

Ruby 42.00% JavaScript 47.77% CSS 0.80% HTML 9.43%

attache-rails's Introduction

No Plan.

attache-rails's People

Contributors

choonkeat avatar flyfy1 avatar jcwilk avatar juanitofatas avatar willnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

attache-rails's Issues

Is turbolinks stopping this from working correctly?

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?

Virus protection

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.

Coffee Script?

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.

assigning to image column fails with ATTACHE_SECRET_KEY

I encountered a weird behavior.

I created users successfully without ATTACHE_SECRET_KEY but raised error with ATTACHE_SECRET_KEY.

  • Log displayed that image data didn't insert into database.
  • Parameters from browser looked no problem.
  • Assigning to image column looked not working.

Is there any idea about that?

I used this sample app.

willnet/attache-sample

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'

Upload progress bar and placeholder picture

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?

exclude certain file types

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.