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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:26:38+00:00 2026-06-18T05:26:38+00:00

I have a model submission and a nested model attachment in submission.rb : has_many

  • 0

I have a model submission and a nested model attachment

in submission.rb:

has_many :assets, :dependent => :destroy
accepts_nested_attributes_for :assets, :allow_destroy => true

in assets.rb :

  attr_accessible :file_id, :attachment
  belongs_to :submission
  has_attached_file :attachment

in my submission controller:

def new
    @submission = Submission.new
    @asset = 2.times{ @submission.assets.build }

    respond_to do |format|
      format.html # new.html.erb
      format.json { render json: @submission }
    end
  end

  def edit
    @submission = Submission.find(params[:id])
    @asset = 2.times{ @submission.assets.build }
  end

And I’m getting a unknown attribute: submission_id error.

What could possibly be wrong here.

I’m following the screencast here:
http://www.emersonlackey.com/article/rails-paperclip-multiple-file-uploads

  • 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-18T05:26:39+00:00Added an answer on June 18, 2026 at 5:26 am

    Seems submission_id is not present in your assets table.

    You have to generate asset model like:

    rails generate model Asset submission_id:integer #rails 3
    

    And then run:

    bundle exec rake db:migrate #rails 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a User model and a Submission model. Each Submission has a ForeignKey
I have model: [XmlRoot(ElementName = event, IsNullable=true)] public class Event { public int id
Suppose in my rails application I have a model Entry, which has a nested
I have a simple has_many belongs_to relationship and I want to include the parent
I have a User model (generated by devise) and a Submission model in a
I have two very simple classes Submission and Store class Submission(models.Model): title = models.CharField(max_length=50,
I have a multi-model form submission that appends all model errors into a single
I have models similar to what is below: class Submission(models.Model): round = models.ForeignKey('Round',related_name='submissions') text
I have model with a location, which itself has a latitude and longitude. What
I have model Foo which has field bar. The bar field should be unique,

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.