Closed bzvyagintsev closed 6 years ago
Same problem here.
Just came across this too, anyone come up with a fix?
anything new about this?
same problem...
same problem
I dealt with this issue somehow or other... I referred the url below. https://github.com/sferik/rails_admin/wiki/Fields
First I fixed initializers/rails_admin.rb
config.model 'User' do
list do
configure :images do # In this case, images is multiple field
hide
end
end
show do
configure :images do
hide
end
end
edit do
field :name
field :address
:
: (You should write not multiple fields you want to edit)
:
# the multiple field
field :images do
partial "my_awesome_partial"
end
end
end
Next, I create new file, app/views/rails_admin/main/_my_awesome_partial.html.erb
<%= form.file_field :images, multiple: true %>
<% @object.myImages.each_with_index do |user, index| %>
<%= image_tag user %>
<a class="btn btn-info btn-remove-image" data-confirm="Are you sure you want to delete this image?" rel="nofollow" data-method="delete" href="/user/<%= @object.id %>/images/<%= index %>">Delete</a>
# The below made an error. I don't know the reason.
<%#= link_to "Delete", user_image_path(@object, index), :method => :delete, data: { confirm: "Are you sure you want to delete this image?" } %>
<% end %>
Same issue. I use @DaichiSaito 's partial solution but it will be very nice to have some declarative one. Something like
config.model 'User' do
edit do
field images: []
end
...
CarrierWave now have experimental feature in master branch - Multiple uploader (based on Postgresql arrays):
But it dont work with rails_admin. Multiple uploader field doesnt appear in new/edit model pages, and if I do something like that:
Im getting following error
So, I discovered, that this error appear, because rails_admin cant work with Postgresql arrays, and rails_admin havent multiple uploading feature .
Is there any solutions?