0693nobodyさん
2018/06/12(火) 05:52:55.15ID:Ys8FqqMF<%= 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 にに保存したいです。
よろしくお願いします。