millions-exabyte-27721
09/11/2024, 2:37 PMImage
with a has_one_attached
, but of course then the user shouldn’t have to create each image individuallyloud-jewelry-99127
09/11/2024, 2:39 PMmillions-exabyte-27721
09/11/2024, 2:40 PMloud-jewelry-99127
09/11/2024, 2:40 PMloud-jewelry-99127
09/11/2024, 2:40 PMImage
resource index view?loud-jewelry-99127
09/11/2024, 2:41 PMloud-jewelry-99127
09/11/2024, 2:42 PMloud-jewelry-99127
09/11/2024, 2:42 PMloud-jewelry-99127
09/11/2024, 2:43 PMmillions-exabyte-27721
09/11/2024, 2:46 PMmillions-exabyte-27721
09/11/2024, 2:48 PMloud-jewelry-99127
09/11/2024, 2:49 PMmillions-exabyte-27721
09/11/2024, 3:02 PMmillions-exabyte-27721
09/11/2024, 3:02 PMloud-jewelry-99127
09/11/2024, 3:06 PMmillions-exabyte-27721
09/11/2024, 3:09 PMtool Avo::ResourceTools::ImageDrop, show_on: :index
doesn't seem to work (the index
part)loud-jewelry-99127
09/11/2024, 3:11 PMmillions-exabyte-27721
09/11/2024, 3:11 PMloud-jewelry-99127
09/11/2024, 3:11 PMmillions-exabyte-27721
09/11/2024, 3:12 PMmillions-exabyte-27721
09/11/2024, 3:12 PMloud-jewelry-99127
09/11/2024, 3:12 PMcomponents
optionloud-jewelry-99127
09/11/2024, 3:13 PMmillions-exabyte-27721
09/11/2024, 3:15 PMmillions-exabyte-27721
09/11/2024, 3:15 PMmillions-exabyte-27721
09/11/2024, 3:16 PMloud-jewelry-99127
09/11/2024, 3:19 PMloud-jewelry-99127
09/11/2024, 3:20 PMloud-jewelry-99127
09/11/2024, 3:21 PMerb
<%# app/components/avo/views/drag_and_drop_resource_index_component.html.erb %>
DnD area here!
<%= render Avo::Views::ResourceIndexComponent.new(**@args) %>
ruby
# app/components/avo/views/drag_and_drop_resource_index_component.rb
# frozen_string_literal: true
class Avo::Views::DragAndDropResourceIndexComponent < Avo::Views::ResourceIndexComponent
def initialize(**args)
@args = args
end
end
And on the resource:
ruby
self.components = -> do
{
resource_index_component: Avo::Views::DragAndDropResourceIndexComponent
}
end
loud-jewelry-99127
09/11/2024, 3:22 PMResourceIndexComponent
you don't need to apply them yourselfmillions-exabyte-27721
09/11/2024, 3:23 PMlemon-wall-20836
09/11/2024, 10:44 PMlemon-wall-20836
09/11/2024, 10:44 PMlemon-wall-20836
09/11/2024, 10:44 PMlemon-wall-20836
09/11/2024, 10:44 PMmillions-exabyte-27721
09/12/2024, 5:49 AMIndex
viewmillions-exabyte-27721
09/12/2024, 6:05 AMloud-jewelry-99127
09/12/2024, 8:10 AMruby
Rails.application.routes.draw do
# ...
end
if defined? ::Avo
Avo::Engine.routes.draw do
scope :resources do
get "courses/cities", to: "courses#cities"
get "users/get_users", to: "users#get_users"
end
end
end
millions-exabyte-27721
09/12/2024, 8:57 AM