Change field name in Rails
Change of column name or attribute rename in your database using Rails is possible with the help of Rails migration files. Here is an example that does just that
class FixColumnNameForImagesProductId < ActiveRecord::Migration
def change
rename_column :images, :products_id, :product_id
end
end