Code Monkey home page Code Monkey logo

rails_admin_dropzone's Introduction

Hi, my name is Luiz Picolo ๐Ÿ‘‹ ๐Ÿ‘‹

Let's Play? Submit your PR with your move.

    1    2    3
1      |   |  
   +---+---+---+
2      | X | 
   +---+---+---+
3      |   |   

How to play

Make the movement above and leave the coordinates below in the table. For example: X in the middle equal to 2:2:X

Player Jogada Won Lost Tied
@luizpicolo 2:2:X

Winners

Player Game
@Mooniemd Finished Game

rails_admin_dropzone's People

Contributors

andreeaene avatar ankit123rudra avatar barmidrol avatar bryanjhv avatar bszala avatar dasio avatar dependabot-preview[bot] avatar dependabot[bot] avatar divayprakash avatar dosten avatar fortrieb avatar i-am-me avatar itaisteinherz avatar ivanorsolic avatar justthegame avatar luizpicolo avatar lyxnx avatar martijnpold avatar mrancys avatar natetheriver avatar nemfoz avatar omeryagmurlu avatar p0v1n0m avatar pish4 avatar robiathin avatar rossiza avatar sacret avatar sarkkisjuha avatar sta111on avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

rails_admin_dropzone's Issues

Show existing images (edit and delete)

Hello,
Is there a way to load the previously uploaded images and edit / delete them ?
If not, are you willing to implement it in the near future ?
Thanks,

Missing template rails_admin/main/dropzone

Nothing visible can be seen on rails_admin, even though I have followed the instructions on the README.

Missing template rails_admin/main/dropzone, rails_admin/application/dropzone, application/dropzone with {:locale=>[:en], :formats=>[:json], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :haml]}

class ProductImage < ActiveRecord::Base
  belongs_to :product
  mount_uploader :image, DefaultUploader
end

class Product < ActiveRecord::Base
    has_many :product_images

    def create_associated_image(image)
        product_images.create(image: image)
    end
end
RailsAdmin.config do |config|
config.actions do
    dashboard                  
    index                        
    new
    dropzone do
      only Product # Example Album
    end
    export
    bulk_delete
    show
    edit
    delete
    show_in_app
  end
end

Add new translations

Today the system has only 3 language. It is interesting to add new translations. Happy translations!

Error if model has _

For example, if you have a model LocationAlbum then the param key will be locationalbum while the @abstract_model.param_key will return location_album.

To fix it:
@params = params[@abstract_model.param_key.gsub('_', '')]

Rails 5.1 cannot use this

ActionController::UnknownFormat in RailsAdmin::MainController#dropzone RailsAdmin::MainController#dropzone is missing a template for this request format and variant. request.formats: ["application/json"] request.variant: [] Extracted source (around line #40): #38 "\nrequest.variant: #{request.variant.inspect}" #39 *40 raise ActionController::UnknownFormat, message #41 elsif interactive_browser_request? #42 message = "#{self.class.name}##{action_name} is missing a template " \ #43 "for this request format and variant.\n\n" \ Extracted source (around line #4): #2 module BasicImplicitRender # :nodoc: #3 def send_action(method, *args) *4 super.tap { default_render unless performed? } #5 end #6 #7 def default_render(*args) Extracted source (around line #4): #2 module BasicImplicitRender # :nodoc: #3 def send_action(method, *args) *4 super.tap { default_render unless performed? } #5 end #6 #7 def default_render(*args) Rails.root: /home/nikhil/workspace/tool Application Trace app/controllers/application_controller.rb:36:in set_current_user' Framework Trace actionpack (5.1.6) lib/action_controller/metal/implicit_render.rb:40:in default_render' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in block in send_action' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in tap' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in send_action' actionpack (5.1.6) lib/abstract_controller/base.rb:186:in process_action' actionpack (5.1.6) lib/action_controller/metal/rendering.rb:30:in process_action' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:20:in block in process_action' activesupport (5.1.6) lib/active_support/callbacks.rb:108:in block in run_callbacks' activesupport (5.1.6) lib/active_support/callbacks.rb:117:in block in run_callbacks' activesupport (5.1.6) lib/active_support/core_ext/time/zones.rb:64:in use_zone' browser-timezone-rails (1.0.1) lib/browser-timezone-rails.rb:15:in set_time_zone' activesupport (5.1.6) lib/active_support/callbacks.rb:117:in block in run_callbacks' activesupport (5.1.6) lib/active_support/callbacks.rb:135:in run_callbacks' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in process_action' actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in process_action' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in block in process_action' activesupport (5.1.6) lib/active_support/notifications.rb:166:in block in instrument' activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (5.1.6) lib/active_support/notifications.rb:166:in instrument' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in process_action' actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in process_action' activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:22:in process_action' actionpack (5.1.6) lib/abstract_controller/base.rb:124:in process' actionview (5.1.6) lib/action_view/rendering.rb:30:in process' actionpack (5.1.6) lib/action_controller/metal.rb:189:in dispatch' actionpack (5.1.6) lib/action_controller/metal.rb:253:in dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in call' railties (5.1.6) lib/rails/engine.rb:522:in call' railties (5.1.6) lib/rails/railtie.rb:185:in public_send' railties (5.1.6) lib/rails/railtie.rb:185:in method_missing' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:17:in block in <class:Constraints>' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:46:in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in call' rack-pjax (1.0.0) lib/rack/pjax.rb:12:in call' http_accept_language (2.1.1) lib/http_accept_language/middleware.rb:14:in call' remotipart (1.4.2) lib/remotipart/middleware.rb:32:in call' warden (1.2.7) lib/warden/manager.rb:36:in block in call' warden (1.2.7) lib/warden/manager.rb:35:in catch' warden (1.2.7) lib/warden/manager.rb:35:in call' rack (2.0.5) lib/rack/etag.rb:25:in call' rack (2.0.5) lib/rack/conditional_get.rb:38:in call' rack (2.0.5) lib/rack/head.rb:12:in call' rack (2.0.5) lib/rack/session/abstract/id.rb:232:in context' rack (2.0.5) lib/rack/session/abstract/id.rb:226:in call' actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in call' activerecord (5.1.6) lib/active_record/migration.rb:556:in call' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in block in call' activesupport (5.1.6) lib/active_support/callbacks.rb:97:in run_callbacks' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in call' actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in call' actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in call' web-console (3.6.2) lib/web_console/middleware.rb:135:in call_app' web-console (3.6.2) lib/web_console/middleware.rb:30:in block in call' web-console (3.6.2) lib/web_console/middleware.rb:20:in catch' web-console (3.6.2) lib/web_console/middleware.rb:20:in call' actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in call' railties (5.1.6) lib/rails/rack/logger.rb:36:in call_app' railties (5.1.6) lib/rails/rack/logger.rb:24:in block in call' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in block in tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in tagged' railties (5.1.6) lib/rails/rack/logger.rb:24:in call' sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call' actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in call' request_store (1.4.1) lib/request_store/middleware.rb:19:in call' actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in call' rack (2.0.5) lib/rack/method_override.rb:22:in call' rack (2.0.5) lib/rack/runtime.rb:22:in call' activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in call' actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in call' actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in call' rack (2.0.5) lib/rack/sendfile.rb:111:in call' railties (5.1.6) lib/rails/engine.rb:522:in call' puma (3.11.4) lib/puma/configuration.rb:225:in call' puma (3.11.4) lib/puma/server.rb:632:in handle_request' puma (3.11.4) lib/puma/server.rb:446:in process_client' puma (3.11.4) lib/puma/server.rb:306:in block in run' puma (3.11.4) lib/puma/thread_pool.rb:120:in block in spawn_thread' Full Trace actionpack (5.1.6) lib/action_controller/metal/implicit_render.rb:40:in default_render' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in block in send_action' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in tap' actionpack (5.1.6) lib/action_controller/metal/basic_implicit_render.rb:4:in send_action' actionpack (5.1.6) lib/abstract_controller/base.rb:186:in process_action' actionpack (5.1.6) lib/action_controller/metal/rendering.rb:30:in process_action' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:20:in block in process_action' activesupport (5.1.6) lib/active_support/callbacks.rb:108:in block in run_callbacks' app/controllers/application_controller.rb:36:in set_current_user' activesupport (5.1.6) lib/active_support/callbacks.rb:117:in block in run_callbacks' activesupport (5.1.6) lib/active_support/core_ext/time/zones.rb:64:in use_zone' browser-timezone-rails (1.0.1) lib/browser-timezone-rails.rb:15:in set_time_zone' activesupport (5.1.6) lib/active_support/callbacks.rb:117:in block in run_callbacks' activesupport (5.1.6) lib/active_support/callbacks.rb:135:in run_callbacks' actionpack (5.1.6) lib/abstract_controller/callbacks.rb:19:in process_action' actionpack (5.1.6) lib/action_controller/metal/rescue.rb:20:in process_action' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:32:in block in process_action' activesupport (5.1.6) lib/active_support/notifications.rb:166:in block in instrument' activesupport (5.1.6) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (5.1.6) lib/active_support/notifications.rb:166:in instrument' actionpack (5.1.6) lib/action_controller/metal/instrumentation.rb:30:in process_action' actionpack (5.1.6) lib/action_controller/metal/params_wrapper.rb:252:in process_action' activerecord (5.1.6) lib/active_record/railties/controller_runtime.rb:22:in process_action' actionpack (5.1.6) lib/abstract_controller/base.rb:124:in process' actionview (5.1.6) lib/action_view/rendering.rb:30:in process' actionpack (5.1.6) lib/action_controller/metal.rb:189:in dispatch' actionpack (5.1.6) lib/action_controller/metal.rb:253:in dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:49:in dispatch' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:31:in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in call' railties (5.1.6) lib/rails/engine.rb:522:in call' railties (5.1.6) lib/rails/railtie.rb:185:in public_send' railties (5.1.6) lib/rails/railtie.rb:185:in method_missing' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:17:in block in class:Constraints' actionpack (5.1.6) lib/action_dispatch/routing/mapper.rb:46:in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:50:in block in serve' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in each' actionpack (5.1.6) lib/action_dispatch/journey/router.rb:33:in serve' actionpack (5.1.6) lib/action_dispatch/routing/route_set.rb:844:in call' rack-pjax (1.0.0) lib/rack/pjax.rb:12:in call' http_accept_language (2.1.1) lib/http_accept_language/middleware.rb:14:in call' remotipart (1.4.2) lib/remotipart/middleware.rb:32:in call' warden (1.2.7) lib/warden/manager.rb:36:in block in call' warden (1.2.7) lib/warden/manager.rb:35:in catch' warden (1.2.7) lib/warden/manager.rb:35:in call' rack (2.0.5) lib/rack/etag.rb:25:in call' rack (2.0.5) lib/rack/conditional_get.rb:38:in call' rack (2.0.5) lib/rack/head.rb:12:in call' rack (2.0.5) lib/rack/session/abstract/id.rb:232:in context' rack (2.0.5) lib/rack/session/abstract/id.rb:226:in call' actionpack (5.1.6) lib/action_dispatch/middleware/cookies.rb:613:in call' activerecord (5.1.6) lib/active_record/migration.rb:556:in call' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:26:in block in call' activesupport (5.1.6) lib/active_support/callbacks.rb:97:in run_callbacks' actionpack (5.1.6) lib/action_dispatch/middleware/callbacks.rb:24:in call' actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in call' actionpack (5.1.6) lib/action_dispatch/middleware/debug_exceptions.rb:59:in call' web-console (3.6.2) lib/web_console/middleware.rb:135:in call_app' web-console (3.6.2) lib/web_console/middleware.rb:30:in block in call' web-console (3.6.2) lib/web_console/middleware.rb:20:in catch' web-console (3.6.2) lib/web_console/middleware.rb:20:in call' actionpack (5.1.6) lib/action_dispatch/middleware/show_exceptions.rb:31:in call' railties (5.1.6) lib/rails/rack/logger.rb:36:in call_app' railties (5.1.6) lib/rails/rack/logger.rb:24:in block in call' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in block in tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (5.1.6) lib/active_support/tagged_logging.rb:69:in tagged' railties (5.1.6) lib/rails/rack/logger.rb:24:in call' sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in call' actionpack (5.1.6) lib/action_dispatch/middleware/remote_ip.rb:79:in call' request_store (1.4.1) lib/request_store/middleware.rb:19:in call' actionpack (5.1.6) lib/action_dispatch/middleware/request_id.rb:25:in call' rack (2.0.5) lib/rack/method_override.rb:22:in call' rack (2.0.5) lib/rack/runtime.rb:22:in call' activesupport (5.1.6) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in call' actionpack (5.1.6) lib/action_dispatch/middleware/executor.rb:12:in call' actionpack (5.1.6) lib/action_dispatch/middleware/static.rb:125:in call' rack (2.0.5) lib/rack/sendfile.rb:111:in call' railties (5.1.6) lib/rails/engine.rb:522:in call' puma (3.11.4) lib/puma/configuration.rb:225:in call' puma (3.11.4) lib/puma/server.rb:632:in handle_request' puma (3.11.4) lib/puma/server.rb:446:in process_client' puma (3.11.4) lib/puma/server.rb:306:in block in run' puma (3.11.4) lib/puma/thread_pool.rb:120:in block in spawn_thread' Request parameters {"utf8"=>"โœ“", "authenticity_token"=>"lmz0xqzgfHl6yS9muaDpgg8iWgGPEEGW/sbd4zwoBbYIeFAVjc96xoZnxaOgtDao0eL0EesS3MGLF7Z+WrfDfA==", "id"=>"7", "gallerycategory"=>{"second_attr"=>[#<ActionDispatch::Http::UploadedFile:0x007f16c18788c0 @tempfile=#Tempfile:/tmp/RackMultipart20180613-14192-7eluxe.png, @original_filename="footsy.png", @content_type="image/png", @headers="Content-Disposition: form-data; name="gallerycategory[second_attr][]"; filename="footsy.png"\r\nContent-Type: image/png\r\n">]}, "model_name"=>"gallery_category"} Session dump _csrf_token: "nRo9+bVrNbZvpSJ8AtzYmTdNkGDypK61z8xt/GKuF7Y=" session_id: "d2d35d18cd7a6393bbe8f53c2cdfa012" warden.user.user.key: [[219], "$2a$11$GGNe4t8r9DC425U.KK7A.O"] Env dump GATEWAY_INTERFACE: "CGI/1.2" HTTP_ACCEPT: "application/json" HTTP_ACCEPT_ENCODING: "gzip, deflate" HTTP_ACCEPT_LANGUAGE: "en,zh;q=0.9,en-US;q=0.8,zh-CN;q=0.7" HTTP_CACHE_CONTROL: "no-cache" HTTP_ORIGIN: "http://rendezvous.nikhillocalgupta.com:3000" HTTP_VERSION: "HTTP/1.1" ORIGINAL_SCRIPT_NAME: "" REMOTE_ADDR: "127.0.0.1" SERVER_NAME: "rendezvous.nikhillocalgupta.com" SERVER_PROTOCOL: "HTTP/1.1" Response headers None

Support for New Records

Hello @luizpicolo,

Your Gem doesn't seem to work when creating new Records.
As far as i can observe this, you instantly upload every dropped image and associate it with its parent record. Thus you can only use the dropzone, when there already is an existing record in the database.

Any plans on enabling dropzone for new records? Or am I using it wrong?

Thanks in advance

Nothing changing in rails admin

Hey there I'm trying to use this gem in my rails project and not having much luck.

Here is a quick background of my different models that I'm trying to integrate you example with.

Class Item: has_many images (assuming this would be album)
Class Image
Class ItemImage < Image: belongs_to item (assuming this would be photo)

In item.rb I added the following like in your example:

def create_associated_image(image)
    images.create(image: image)
end

in my rails_admin.rb I added:

dropzone do
  only Image
end

Is there anything i have missed or any other stuff that I need to do?

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.