You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is something where we would want to change how the gem works in 7.1 or not, but when upgrading to Rails 7.1 from Rails 7 we've found our conditional reveals break, specifically because we have a (SLIM) partial that does:
= form.govuk_radio_button field_name, ...
= yield if some_condition
This works fine if some_condition is true, but when it is false we end up with the equivalent of:
= form.govuk_radio_button field_name, ...
= nil
That = nil is treated differently in Rails 7.1 to 7.0. Specifically, suppose we have a typical 'Yes'/'No' radio button with a conditional reveal attached to the 'Yes'. In Rails 7.1, with an effective = nil passed to the 'No' option, we end up, very surprisingly, with this:
Excitingly, the 'Yes' option is re-rendered as the conditional reveal of the 'No' option!
The text was updated successfully, but these errors were encountered:
Thanks for looking into this! Yes, I think you've found what the issue was. We're now on 7.1.2 and are no longer experiencing the problem with = nil, so can go back to one-line = yield if statements for our conditional reveals.
I'm not sure if this is something where we would want to change how the gem works in 7.1 or not, but when upgrading to Rails 7.1 from Rails 7 we've found our conditional reveals break, specifically because we have a (SLIM) partial that does:
This works fine if
some_condition
is true, but when it is false we end up with the equivalent of:That
= nil
is treated differently in Rails 7.1 to 7.0. Specifically, suppose we have a typical 'Yes'/'No' radio button with a conditional reveal attached to the 'Yes'. In Rails 7.1, with an effective= nil
passed to the 'No' option, we end up, very surprisingly, with this:Excitingly, the 'Yes' option is re-rendered as the conditional reveal of the 'No' option!
The text was updated successfully, but these errors were encountered: