新手问题 View 文件中的 model_class 定义 <%- model_class = Item -%>

lebao · October 27, 2015 · Last by lebao replied at October 27, 2015 · 1275 hits

<%= t '.title', :default => model_class.model_name.human.titleize %>

看代码的时候 看到 View 文件里面 有这么一段,没搞明白 ,google 也没找到 很好的解释... 为什么 定义 用 <%- - %> 这个符号属于什么?? 还有这段 model_class.model_name.human.titleize 这个是属性么?? css 定义?? 恳请 知道的 能 说明下

<%- -%> 是表示去掉附近的空格输出

#1 楼 @huacnlee 谢谢。明白了..

You need to Sign in before reply, if you don't have an account, please Sign up first.