helper和helper_method做了什麼? - What do helper and helper_method do?

問題:

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 ) (可能是名helperhelper_method是一樣的。他們可能寧願改爲share_methods_with_viewimport_methods_from_view

reference 參考


解決方案:

參考一: https://en.stackoom.com/question/Gkfj
參考二: https://stackoom.com/question/Gkfj
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章