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
Router helpers are breaking if param_accessor_style is legacy.
Problem is router uses params, and param_accessor_style is determined by the application, so the Router needs a consistent way to reference params.
Solution is for the Router to use the alias: feature, to create a instance variable accessor to params.
For example the location router param is aliased to _location_param and the router counts on @_location_param to be initialized regardless of the param_accessor_style.
But currently alias: is being applied to legacy param.xxx style accessors, which then breaks the application code. For example application code historically can use either the location helper method or params.location to get the location value. But if we apply alias to legacy param names then it becomes params._location_param.
So the solution is to NOT honor alias for the legacy param name (only for the instance variable name, and the direct accessor method name.)
Related though is that in the PropsWrapper initializer we don't initialize instance variables if accessor_style is :legacy.
The text was updated successfully, but these errors were encountered:
Router helpers are breaking if
param_accessor_style
is legacy.Problem is router uses params, and param_accessor_style is determined by the application, so the Router needs a consistent way to reference params.
Solution is for the Router to use the
alias:
feature, to create a instance variable accessor to params.For example the
location
router param is aliased to_location_param
and the router counts on@_location_param
to be initialized regardless of the param_accessor_style.But currently
alias:
is being applied to legacyparam.xxx
style accessors, which then breaks the application code. For example application code historically can use either thelocation
helper method orparams.location
to get the location value. But if we apply alias to legacy param names then it becomesparams._location_param
.So the solution is to NOT honor alias for the legacy param name (only for the instance variable name, and the direct accessor method name.)
Related though is that in the PropsWrapper initializer we don't initialize instance variables if accessor_style is :legacy.
The text was updated successfully, but these errors were encountered: