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

  • SEARCH
  • Home
  • 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 7602689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:28:33+00:00 2026-05-30T23:28:33+00:00

I have a crud with paperclip and multiple images’ i implement active_admin and the

  • 0

I have a crud with paperclip and multiple images’ i implement active_admin and the product update fine, but, i can’t not upload or edit the multiple images, the form i have is this:

form :html => { :multipart => true } do |f|
  f.inputs "Details" do
    f.input :name
    f.input :created_at, :label => "Publish Product at"
    f.input :category
  end

  f.inputs "Images" do
    f.has_many :assets do |p|
      p.input :asset, :as => :file, :input_html => { :multiple => true }, :label => "Image", :hint => p.object.asset.nil? ? p.template.content_tag(:span, "No Image Yet") : p.template.image_tag(p.object.asset.url(:thumb))
      p.input :_destroy, :as=>:boolean, :required => false, :label=>'Remove'
    end
  end

  f.inputs "Content" do
    f.input :description
  end
  f.buttons
end

and the…

f.inputs "Images" do
    f.has_many :assets do |p|
      p.input :asset, :as => :file, :input_html => { :multiple => true }, :label => "Image", :hint => p.object.asset.nil? ? p.template.content_tag(:span, "No Image Yet") : p.template.image_tag(p.object.asset.url(:thumb))
      p.input :_destroy, :as=>:boolean, :required => false, :label=>'Remove'
    end
  end

I want to upload images, but when i create a new asset this have a missing image default and not attach the correct image, i think because the path from the images is not correct to upload. My asset model is:

 class Asset < ActiveRecord::Base
   belongs_to :product
   has_attached_file :asset, :styles => { :large => "340x330", :medium => "140x80>", :thumb => "70x70>" },
     :url => "/products/:id/:style/:basename.:extension",  
     :path => ":rails_root/public/products/:id/:style/:basename.:extension"
 end

how i can modify my assets form to work like i want? Thank you!

  • 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-05-30T23:28:34+00:00Added an answer on May 30, 2026 at 11:28 pm

    The Solution

    Hi, here is the solution, the key are how work the nested attributes in formtastic…

     form :html => { :multipart => true } do |f|
       f.inputs "Product information" do
         f.input :name
         f.input :description
       end
    
       f.inputs "Product images" do
         f.has_many :assets do |p|
           p.input :asset, :as => :file, :label => "Image",:hint => p.object.asset.nil? ? p.template.content_tag(:span, "No Image Yet") : p.template.image_tag(p.object.asset.url(:thumb))
           p.input :_destroy, :as=>:boolean, :required => false, :label => 'Remove image'
         end 
       end
    
       f.inputs "Product details" do
         f.input :category, :label => "Category", :hint => "Select one category"
         f.input :height
         f.input :width
         f.input :depth
         f.input :color, :label => "Color", :hint => "Select one color"
         f.input :sku, :label => "SKU"
         f.input :price
       end
       f.buttons
     end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic CRUD form that uses PageMethods to update the user details,
So basically i have a backend ORM class which can do all the CRUD
I have YoutubeVideoService class which does CRUD(Create, Read, Update, and Delete) operations. In my
I have a custom edit form for some entity (not based on the CRUD
I have a CRUD winform App that uses Merge Replication to allow disconnected functionality.
I have a simple Crud application where there is one filed called Category. During
Okay I have a large CRUD app that uses tabs with Forms embedded in
I have a fairly large CRUD winform app that is set up to display
I have written a simple CRUD form which has one select list. However the
I have a class that provide the CRUD operation for an entity.Im using 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.