Here is the HTML form:
- form_for @changeset, @action, [class: "ui form"], fn f ->
- if @changeset.action do
Oops, something went wrong! Please check the errors below.
= label f, :cost
= number_input f, :cost, step: "any"
= error_tag f, :cost
= label f, :end_date
= datetime_select f, :end_date
= error_tag f, :end_date
=label f, :paused
= checkbox f, :paused
= error_tag f, :paused
= submit "Submit", class: "ui primary button"
You indeed understand it correctly.
The main problem I now have, is how to show again a boolean in the User Interface.
Right now I have a function called
Subscription.paused?/1 that checks the paused_at, but what I'd rather want to do, is to set the boolean correctly when retrieving the struct from the database.
Is that possible?