Starting from Rails 5.1, `form_with` behavior is to generate remote
forms by default.
However with Turbolinks disabled, the form gets sent, but nothing is set
up to handle the server response (like replacing the content of the
page).
So we have two choices: either enable a global config option that makes
`form_with` generate non-remote forms, or do it explicitely on each
form. I chose the explicit way, so that developers expecting the usual
remote behavior of `form_with` are not surprised.
- Tooltips are no longer used anywhere
- They cause an error on app initialisation
Fixes "TypeError: dataAttributes.hasOwnProperty is not a function" error
that we've been seeing recently on Sentry.
Turns out that assigning the params to the procedure calls `read` on the
images files. Calling `read` moves the seek offset to the end of the
file; which means that subsequent calls to `read` return an empty
string.
Fix the issue by calling `rewind` before attempting to `read` the file,
to ensure the seek offset is at the beginning of the file.
Fix#4958
The main problem come from
%label{for: input_id}
#{champ.libelle}
%span.notice= string_to_html(champ.description)
%input
where string_to_html contains p tags
The proposed solution is
%label #{champ.libelle}
%p.notice
%input
It should be iso in the graphic sense.
Before the form attempted to read an email value from the Instructeur
model, and failed (because the empty Instructeur had no user yet).
We could let `Instructeur#email` return `nil` if there is no User –
but as a created Instructeur is always supposed to have a User, this
seems like a nice safeguard to keep.
So instead this commit rewrites the create form, which now doesn’t
depend on an Instructeur model. Seems easy enough for now.
* Get rid of the “reopen” event, merge it with “publish” (it’s the same code)
* Remove the “availability” states; “available with brouillon” makes no sense since the brouillons path are always uuids
* Instead of checking if publish can happen, just try it and handle the errors