I have this field
<%= number_input f, :duration_minutes %>
and I would like to give it a default of 60. How can I do that?
The obvious guess of
<%= number_input f, :duration_minutes, default: 60 %>
didn't work.
I have this field
<%= number_input f, :duration_minutes %>
and I would like to give it a default of 60. How can I do that?
The obvious guess of
<%= number_input f, :duration_minutes, default: 60 %>
didn't work.
Update based on the comment from Allen:
schema "events" do
field :duration_minutes, :integer, default: 60
end
Here is my previous answer that isn't as robust according to him:
<%= number_input f, :duration_minutes, value: 60 %>