#new.html.erb
<%= simple_form_for @math do |f| %>
<%= f.input :num_1 %>
<%= f.input :num_2 %>
<%= f.button :submit, "OK!" %>
<% end %>

class CreateScores < ActiveRecord::Migration[5.2]
def change
create_table :scores do |t|
t.integer :num_1
t.integer :num_2
t.integer :ans

t.timestamps
end
end
end

num_1 と num_2 の積を計算して ans にに保存したいです。
よろしくお願いします。