Vote #67688
未完了Hooks should provide all controller instance variables by default
0%
説明
Currently, many hook calls provide some of the instance variables of the respective controller instance to the hook (plus some additional data). In #5932, it was shown again, that this data is often not sufficient.
A "common" pattern is to use @context[:controller].instance_variable_get("@my_var")@ which is rather hacky from an API point of view. It would be better if by default all instance variables of the controller could be provided to the hook.
The best implementation would probably be by providing a proxy object to the hook. That way, the usage would not be restricted much but could provide a much cleaner API. Another possibility would be to copy some of the logic from the variable passing from the controller to the view.
表示するデータがありません