rails 开发随手记 9
ruby 根据名称确定类
Object.const_get
一个简单的应用,在header中的,个人信息链应该链接到对应的用户类型的页面上。
<%= link_to "个人信息", Object.const_get(current_user.account_type).find(current_user.account_id) %>
ruby 根据名称确定类
Object.const_get
一个简单的应用,在header中的,个人信息链应该链接到对应的用户类型的页面上。
<%= link_to "个人信息", Object.const_get(current_user.account_type).find(current_user.account_id) %>