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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:48:11+00:00 2026-05-25T09:48:11+00:00

I am using two collection_select helpers on a page. The lists themselves get populated

  • 0

I am using two collection_select helpers on a page. The lists themselves get populated correctly but when I go to submit the form NULL is passed to the Insert. Not sure what I am doing wrong here. UPDATE: Added Controller code

New.html.erb:

<h1>New map_apps_suite</h1>

<%= render 'form' %>

<%= link_to 'Back', map_apps_suites_path %>

Form Code:

<%= form_for(@map_apps_suite) do |f| %>
  <% if @map_apps_suite.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@map_apps_suite.errors.count, "error") %> prohibited this map_apps_suite from being saved:</h2>

      <ul>
      <% @map_apps_suite.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

    <div>
        <%= f.label "Application Name:" %>
        <%= collection_select(:death_burrito_application, :id, DeathBurritoApplication.all, :id, :death_burrito_name, :prompt => true) %>
    </div>
        <br>
        <br>
    <div>
        <%= f.label "Project Name:" %>
        <%= collection_select(:custom_product_suite, :id, CustomProductSuite.all, :id, :product_suite_name, :prompt => true) %>
    </div>

  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

Log:

Started POST “/map_apps_suites” for 127.0.0.1 at Fri Sep 02 20:57:10
-0700 2011 Processing by MapAppsSuitesController#create as HTML
Parameters: {“commit”=>”Create Map apps suite”,
“death_burrito_application”=>{“id”=>”3200”},
“authenticity_token”=>”0PP2U50CScjTbcUdRgbIjkExqo9k3psjlcf4w61ZpqI=”,
“utf8″=>”✓”, “custom_product_suite”=>{“id”=>”1”}} [1m[36mSQL
(0.0ms)[0m [1mBEGIN[0m [1m[35mSQL (13.0ms)[0m describe
map_apps_suites [1m[36mAREL (22.0ms)[0m [1mINSERT INTO
map_apps_suites (custom_product_suite_id,
death_burrito_application_id) VALUES (NULL, NULL)[0m [1m[35mSQL
(44.0ms)[0m COMMIT Redirected to
http://localhost:3000/map_apps_suites/3 Completed 302 Found in 185ms

Controller Code for Create, New:

class MapAppsSuitesController < ApplicationController
  before_filter :get_apps, :only => [:new, :edit, :destroy, :update]
  before_filter :get_suites, :only => [:new, :edit, :destroy, :update]

  def get_apps
    @applications = DeathBurritoApplication.order(:death_burrito_name).all
  end

  def get_suites
    @custom_prod_suites = CustomProductSuite.order(:product_suite_name).all
  end

  def new
    @map_apps_suite = MapAppsSuite.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @map_apps_suite }
    end
  end
  def create
    @map_apps_suite = MapAppsSuite.new(params[:map_apps_suite])
    Rails.logger.debug("Params: " + params.inspect)

    respond_to do |format|
      if @map_apps_suite.save
        format.html { redirect_to(@map_apps_suite, :notice => 'Map apps suite was successfully created.') }
        format.xml  { render :xml => @map_apps_suite, :status => :created, :location => @map_apps_suite }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @map_apps_suite.errors, :status => :unprocessable_entity }
      end
    end
  end
  • 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-25T09:48:12+00:00Added an answer on May 25, 2026 at 9:48 am

    I think you want to save in your custom_product_suite_id and in death_burrito_application_id your map_apps_suites table

    You can save this using either of following two ways

    1] change html and remain controller code as it is

    <%= collection_select(:map_apps_suite, :death_burrito_application_id, DeathBurritoApplication.all, :id, :death_burrito_name, :prompt => true) %>
    
    
     <%= collection_select(:map_apps_suite, :custom_product_suite_id, CustomProductSuite.all, :id, :product_suite_name, :prompt => true) %>
    

    OR Just add f. to collection_select

    <%= f.collection_select(:death_burrito_application_id, DeathBurritoApplication.all, :id, :death_burrito_name, :prompt => true) %>
    
    
     <%= f.collection_select(:custom_product_suite_id, CustomProductSuite.all, :id, :product_suite_name, :prompt => true) %>
    

    2] change the create method like following and remain html as it is

        @map_apps_suite=MapAppsSuite.new(:custom_product_suite_id=>params[:custom_product_suite][:id], 
                                 :death_burrito_application_id => params[:death_burrito_application_id][:id])
    

    I hope this helps

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

Sidebar

Related Questions

I currently am using two stylesheets to get my intended output. The first stylesheet
I was using two TButton components on a form that functioned as Plus and
I have two models, Story and Category. Using the form for Story#new , I'd
I'm using two different libraries in my project, and both of them supply a
I'm using two commercial libraries that are produced by the same vendor, called VendorLibA
I'm currently using two libraries (prototype and jQuery), thus I've implemented the jQuery noConflict
I'm using two different version of php on two different OS's. One is 5.2.9
In Django I am using two applications: python manage.py startapp books python manage.py startapp
I am currently using two catch blocks after a try block. The first catches
I'm using two bindings TCP and HTTP. I want to give mex data on

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.