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 9233191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:29:36+00:00 2026-06-18T06:29:36+00:00

Here is my need: I have three prize, each prize has one pic, like:

  • 0

Here is my need:

I have three prize, each prize has one pic, like:

prize1 pic1
prize2 pic2
prize3 pic3

Here is my design:

I use four record in my database, row 1 to 3 is mappingt to prize1 to prize3, and row4 is a default prize which can be used as adding prize.

Here comes the question:

When is user paperclip to upload my pic, there’s some problem to identify each pic. Details are following:

<form>
<input type="file" name="pic[]">
<input type="file" name="pic[]">
<input type="file" name="pic[]">
<input type="submit">
</form>

When I choose choose file to upload and submit the form, pic array will be passed by params, so I can get the the pic, and save them by the ordering of array.

However, when I only choose file for one prize, the array’s size will be 1, and I couldn’t judge which one has changed in the backend, so I’d like to hear from all of you, let me have a look at how you design it or could I make some changes to solve it!

Tanks any way

  • 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-18T06:29:38+00:00Added an answer on June 18, 2026 at 6:29 am

    You will want to make sure that the photo upload is the correct resource that is updating the prize that you are wanting.

    Assuming that each prize in your database has its own row and paperclip column set up correctly you will want the form to be like this:

    = form_for @prize, method: 'put', html: { multipart: true } do |f|
      = f.file 'pic'
      = f.submit
    

    This should PUT the the picture information to the /prize/1234 and the controller should consider the photo fields/params as attributes and update accordingly.

    Things to watch out for:

    1. Don’t forget to add multi-part
    2. Make sure that paperclip is configured properly
    3. Make sure that other attributed in thr form for the product can be updated as well

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the idea I would like to develop. I need to have an
i have day, month, year, value columns in one table, here i need to
Suppose I have a list of three products (A, B C). Each Product has
I need to have a linked text inside a svg graph. Here is what
I have a need to rename a file after download using php cURL. Here's
I really need help here. I'm desperate at this point. I have NSOperation that
Here I have 2 requirements: Need a batch file to start a process on
Here's what I need to fetch: - posts that have comments - number of
here's my question: I have an MVC3 C# application and I need to update
need a quick help here. I have a series of hyperlinks all with the

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.