armadillo:使用 ERB 模板继承模板

时间:2021-06-19 22:31:23
【文件属性】:
文件名称:armadillo:使用 ERB 模板继承模板
文件大小:11KB
文件格式:ZIP
更新时间:2021-06-19 22:31:23
ruby erb armadillo template-inheritance Ruby 犰狳 一个适用于 ERB 小型库。 用法 要渲染 Armadillo 模板,您需要调用Armadillo.render方法。 此方法接受以下任何选项: :scope - 要绑定到模板范围的任何对象。 :base_path - 要搜索模板的目录的路径。 注意:假定每个文件都有一个.erb扩展名,并且不应作为模板文件名给出的文件名的一部分。 Armadillo . render ( "myview.html" , { :items => [ 1 , 2 , 3 ] } , { :base_path => File . join ( Dir . pwd , "views" ) , :scope => self } ) <!-- views/myview.html.erb --> <% extends ( "base.html" ) %> <% vlock ( :title
【文件预览】:
armadillo-master
----Rakefile(139B)
----LICENSE(1KB)
----spec()
--------templates()
--------template_spec.rb(4KB)
--------spec_helper.rb(71B)
----.gitignore(571B)
----lib()
--------armadillo.rb(5KB)
----armadillo.gemspec(604B)
----README.md(2KB)

网友评论