波洛:胡须上的胡须

时间:2021-02-23 14:17:23
【文件属性】:
文件名称:波洛:胡须上的胡须
文件大小:16KB
文件格式:ZIP
更新时间:2021-02-23 14:17:23
波洛 描述 允许您在Rails中使用模板部分,也提供帮助方法,可以轻松地使JavaScript重用相同的模板。 用法 就像使用erb一样创建部分文件,在名称前加上下划线。 app/views/posts/_post_list.html.mustache 该模板将有权访问所有常规的rails helper方法以及在控制器中设置的任何实例变量。 如果您不仅仅需要包含一个可选的视图类,则它应与部分视图具有相同的名称,但不能带下划线。 app/views/posts/post_list_view.rb module Posts class PostListView < Poirot::View def foo "bar" end def post_link post_path(post) end end end 视图类可以访问所有
【文件预览】:
poirot-master
----Readme.markdown(3KB)
----vendor()
--------assets()
----Rakefile(51B)
----Gemfile(127B)
----Gemfile.lock(2KB)
----.gitignore(20B)
----lib()
--------poirot.rb(490B)
--------poirot()
--------generators()
----poirot.gemspec(795B)

网友评论