問題:
helper_method
is straightforward: it makes some or all of the controller's methods available to the view. helper_method
很簡單:它使部分或全部控制器的方法可用於視圖。
What is helper
? 什麼是helper
? Is it the other way around, ie, it imports helper methods into a file or a module? 是否相反,即它將輔助方法導入文件或模塊? (Maybe the name helper
and helper_method
are alike. They may rather instead be share_methods_with_view
and import_methods_from_view
) (可能是名helper
和helper_method
是一樣的。他們可能寧願改爲share_methods_with_view
和import_methods_from_view
)
解決方案:
參考一: https://en.stackoom.com/question/Gkfj參考二: https://stackoom.com/question/Gkfj