If you want to store a letter in your DB, that column type can't be a decimal or integer. A string field would be more appropriate for your case. I'll assume your main question is regarding decimals though.
If you do want to change a column type in the DB, you're supposed to do it using Migrations. From terminal, in your app directory, run: bin/rails g migration changeFieldNameFromIntegerToDecimal
.
This will generate a migration file with a timestamp in the filename, in which there is a change method telling rails how you want to change the database. In that change method, put:
def change
change_column :table_name, :column_name, :decimal, precision: :8, scale: :2
end
the precision and scale options do the follwing (from the above link):
precision: Defines the precision for the decimal fields, representing the total number of digits in the number.
scale: Defines the scale for the decimal fields, representing the number of digits after the decimal point.
If you want to convert it to a string, then the migration file would contain:
def change
change_column :table_name, :column_name, :string
end
Finally run bin/rails db:migrate
from the terminal in your app directory to execute the migration.