Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9162751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:17:12+00:00 2026-06-17T14:17:12+00:00

The idea is looping the image array in the controller then store each of

  • 0

The idea is looping the image array in the controller then store each of them. The request shows correct info about uploaded images

{"utf8"=>"✓",
"authenticity_token"=>"usbr1ma8uKWBPiVFKh8AKoGYeaZTWAlLXscMBlFYyhw=",
"painting"=>{"name"=>"",
"image"=>[#<ActionDispatch::Http::UploadedFile:0x007fb414becad8 @original_filename="union_creek.jpg", @content_type="image/jpeg",
@headers="Content-Disposition: form-data; name=\"painting[image][]\"; filename=\"union_creek.jpg\"\r\nContent-Type: image/jpeg\r\n",
@tempfile=#<File:/var/folders/80/2pcl195n7_x0l8bnrjrp4xw40000gn/T/RackMultipart20130105-7179-kr8a7e>>,
#<ActionDispatch::Http::UploadedFile:0x007fb414beca10 @original_filename="what_lies_beneath.jpg",
@content_type="image/jpeg",
@headers="Content-Disposition: form-data; name=\"painting[image][]\"; filename=\"what_lies_beneath.jpg\"\r\nContent-Type: image/jpeg\r\n",
@tempfile=#<File:/var/folders/80/2pcl195n7_x0l8bnrjrp4xw40000gn/T/RackMultipart20130105-7179-iclmmw>>]},
"commit"=>"Create Painting",
"gallery_id"=>"13"}

However I got an misleading error when carrierwave attempts to store those of images

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

The view

= form_for [@gallery, @gallery.paintings.new] do |f|
  %p= f.text_field :name, placeholder: "Enter painting name"
  %p= f.file_field :image, multiple: true
  %p= f.submit %>

The controller

uploader = ImageUploader.new
params[:painting][:image].each do |img|
  uploader.store!(img) # crash here
end

I see something wrong with the controller but I couldn’t figure any better way to store multiple files with carrier.

Could anyone point me out ? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:17:13+00:00Added an answer on June 17, 2026 at 2:17 pm

    This is solution for anyone have the same problem

    params[:painting][:image].map { |img| gallery.paintings.create(name: img.original_filename , image: img)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

idea I would like to create a little app for myself to store ideas
I am trying to store data gotton from JSON to an normal string array.
I'm looking for idea's how to convert a 30+gb, 2000+ colored TIFF image series
I am looking for a fast idea/algorithm letting me to find squares (as mark
I am looking for an idea, concept or proven datastructure that would be very
I'm just looking a big picture idea here; I can google specifics once provided
I am getting the following stacktrace and have no idea what I am looking
idea Via jQuery, I was able to mark all :first-child and :last-child elements in
Idea: I want to make smth like real time electronic blackboard. Many users have
Any idea on how can I track users bookmarking event? I want to find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.