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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:06:26+00:00 2026-06-07T08:06:26+00:00

I am getting this error 1 error(s) on assignment of multiparameter attributes And I

  • 0

I am getting this error

1 error(s) on assignment of multiparameter attributes

And I am pretty sure it is from the date_selector.

Here is my model

class Order < ActiveRecord::Base
  attr_accessor :card_type, :card_number, :card_verification, 
    :card_expires_on # I do not have these fields in my database
  attr_accessible :cart_id, :card_expires_on, :card_type, :first_name, 
    :ip_address, :last_name,:card_number, :card_verification, :zip, :address, 
    :state, :city

  def credit_card
    @credit_card ||= ActiveMerchant::Billing::CreditCard.new(
      :brand              => card_type,
      :number             => card_number,
      :verification_value => card_verification,
      :month              => card_expires_on.month,
      :year               => card_expires_on.year,
      :first_name         => first_name,
      :last_name          => last_name
      )
  end
end

And the part of the controller that is involved

def create
  @user = current_user
  @cart = current_cart
  @order = @cart.build_order(params[:order]) # here is where the error is
  @order.user_id = @user.id
  @order.ip_address = request.remote_ip
  ...
end

Here is the cart Model

class Cart < ActiveRecord::Base
  has_many :line_items, :dependent => :destroy
  has_one :order
  belongs_to :user

  def add_product(product_id)
    current_item = line_items.find_by_product_id(product_id)
    if current_item
      current_item.quantity += 1
    else
      current_item = line_items.build(:product_id => product_id)
    end
    current_item
  end

  def total_price
    line_items.to_a.sum { |item| item.total_price}
  end

  def total_price_in_cents
    return Integer(total_price * 100)
  end
end

And heres the order form that goes along with order.rb…Thank you again for the help!!!

<div class="field">
   <%= f.label :first_name %><br />
<%= f.text_field :first_name %>
</div>
<div class="field">
  <%= f.label :last_name %><br />
  <%= f.text_field :last_name %>
</div>
<div class="field">
  <%= f.label :address %>
  <%= f.text_field :address %>
</div>
<div class="field">
  <%= f.label :city %>
  <%= f.text_field :city %>
</div>
<div class="field">
  <%= f.label :state %>
  <%= f.select :state, @order.us_states %>
</div>
<div class="field">
  <%= f.label :zip %>
  <%= f.text_field :zip %>
</div>
<div class ="field">
  <%= f.label :card_type %> <br />
  <%= f.select :card_type, [["Visa", "visa"], ["MasterCard", "master"], ["Discover", "discover"], ["American Express", "american_express"]] %>
</div>
<div class="field">
  <%= f.label :card_number %><br />
  <%= f.text_field :card_number %>
</div>
<div class="field">ry
  <%= f.label :card_verification, "Card Verification (CVV)" %><br />
  <%= f.text_field :card_verification %>
</div>
<div class="field">
  <%= f.label :card_expires_on %><br />
  <%= f.date_select :card_expires_on, :discard_day => true, :start_year => Date.today.year, :end_year => (Date.today.year+10), :add_month_numbers => true %>
</div>
<div class="actions">
  <%= f.submit %>
</div>
  • 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-07T08:06:28+00:00Added an answer on June 7, 2026 at 8:06 am

    Have you tried @order = @cart.orders.new(params[:order])?

    In the case of a one-to-one relationship between an order and a cart, that would be:
    @cart.order.new(params[:order])

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

Sidebar

Related Questions

I am overloading the assignment operator, and am getting this error. Cannot solve it.
i am getting an error: invalid lvalue in assignment. this is the only error
I am getting a very strange error in my code. This assignment is for
Hey I am getting this error: error: conversion to non-scalar type requested Here are
I am busy with an assignment an I am getting an error from the
I am working on an assignment and I am getting this error which I
Getting this error: 2009-09-03 12:44:02.307 xcodebuild[307:10b] warning: compiler 'com.apple.compilers.llvm.clang.1_0.analyzer' is based on missing compiler
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
Getting this error when try to add an item to my repositories/context: Collection has
Am getting this error message and matched my brackets and couldn't find anything wrong.

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.