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
After upgrading to inertia-rails 3.4.0, an error occurs in our application that wasn't present in version 3.3.0. The error seems related to how inertia expects errors props.
Error Details
When attempting to redirect with a plain string as the errors value, the following error is raised:
1) SessionsController POST /sign_in with invalid credentials returns unauthorized status
Failure/Error: redirect_to sign_in_path, inertia: { errors: "Credenciais Inválidas" }
NoMethodError:
undefined method `to_hash' for an instance of String
# ./app/controllers/sessions_controller.rb:22:in `create'
# ./spec/requests/sessions_controller_spec.rb:26:in `block (4 levels) in <top (required)>'
Steps to Reproduce
Upgrade inertia-rails from version 3.3.0 to 3.4.0.
Add a redirect_to call in your controller that passes a plain string in the inertia data, as shown below:
In version 3.3.0, passing a plain string in the errors key worked without issues. It’s expected that inertia should continue supporting plain strings as valid values in the inertia data payload.
Actual Behavior
In version 3.4.0, it appears inertia now expects the errors value to be a hash. Passing a plain string raises a NoMethodError.
The text was updated successfully, but these errors were encountered:
merged! will be in the next release. @skryukov 's fix adds graceful nudge towards passing a hash rather than sticking with the stricter enforcement-by-exception!
Bug Description
After upgrading to
inertia-rails
3.4.0, an error occurs in our application that wasn't present in version 3.3.0. The error seems related to howinertia
expects errors props.Error Details
When attempting to redirect with a plain string as the
errors
value, the following error is raised:Steps to Reproduce
inertia-rails
from version 3.3.0 to 3.4.0.redirect_to
call in your controller that passes a plain string in theinertia
data, as shown below:Relevant Code Snippet
Here's the controller action causing the error:
Expected Behavior
In version 3.3.0, passing a plain string in the
errors
key worked without issues. It’s expected thatinertia
should continue supporting plain strings as valid values in theinertia
data payload.Actual Behavior
In version 3.4.0, it appears
inertia
now expects theerrors
value to be a hash. Passing a plain string raises aNoMethodError
.The text was updated successfully, but these errors were encountered: