I\'m new to rails and trying to make a simple site to start learning. When I submit my form, however, the data isn\'t saved to the db. I\'m really not sure what\'s wrong, I\'ve
if you are using form_for
, use the form_for syntax
<%= form_for(@calculate) do |form| %>
<%= form.label :number %>
<%= form.text_field :number %>
<%= form.label :root %>
<%= form.text_field :root %>
<%= form.submit "Submit" %>
<% end %>
this will automatically handle the routes if the @calculate
is new object it will submit it to create or if it is already saved it will send a put request to edit action