I created a model in my Rails app and realized after some time that I had forgotten to add some attributes, and later added them via a generated migration.
I now realize that the order of the attribute columns in schema.rb
is the order that they will appear in a generated resource view in ActiveAdmin.
I want to reorder the columns when I view that model in ActiveAdmin, and the only way I have thought to do so is by changing the column order in the database.
I have looked here and here, and attempted to run a database migration using change_table
or change_column
. This had no resulting change.
This is migration I ran, which had no result:
class Reordercolumn < ActiveRecord::Migration[5.0]
def up
change_table :student_details do |t|
t.change :exact_length, :text, after: :length_of_stay
t.change :returned_home, :boolean, after: :spouse_name
t.change :has_spouse, :boolean, after: :expectation
end
end
end
Looking to view attribute columns in ActiveAdmin in a particular order, I ran a database migration to change columns, but the migration is not reordering the columns.