ActiveModel::MassAssignmentSecurity::Error in OrdersController#create
Can’t mass-assign protected attributes: name, address, email
I’m trying and use a book -> Pragmatic Agile Web Development with Rails 4th Edition.
edit the order model app/models/order.rb
class Order < ActiveRecord::Base has_many :line_items, dependent: :destroy attr_accessible :name, :address, :email, :pay_type end
adding :name, :address, :email to the attr_accessible line in the order model