title: How to ignore extra params while creating model record in Rails 4?
body: <pre><code>#Creating Products
  class CreateProducts &lt; ActiveRecord::Migration
    def change
      create_table :products do |t|
        t.string :name
        t.string :sku_id
        t.integer :price
        t.text :description
        t.datetime :expire_date
        t.boolean :admin_approved
  
        t.timestamps null: false
        t.index :sku_id
      end
    end
  end
  
  # Class for Products
  class Product &lt; ActiveRecord::Base
    has_many :tags
    has_many :images
    has_and_belongs_to_many :categories,
     :join_table =&gt; :products_categories_mapping
    has_and_belongs_to_many :tags,
     :join_table =&gt; :products_tags_mapping
    validates :sku_id, :uniqueness =&gt; { "case_sensitive" =&gt; false }
    validates :name, presence: true
  end
  </code></pre>
  
  <p>From the console, I am trying <code>Product.create(params)</code> and getting the following error with <code>params = {:name=&gt;"XYZ", :sku_id=&gt;"XXX", :source=&gt;"API"}</code></p>
  
  <pre><code>ActiveRecord::UnknownAttributeError: unknown attribute 'source' for Product.
  </code></pre>