2012-08-24 56 views
0

如何覆蓋TowerJS中模板的渲染方式?我知道我可以使用玉,但如果我堅持了CoffeeKup,我怎麼可能,例如有這樣的代碼:在TowerJS視圖中覆蓋模板邏輯

formFor @user, (form) -> 
    form.fieldset "Profile", (fields) -> 
    fields.field "firstName" 
    fields.field "lastName" 
    fields.field "email" 
    form.fieldset "Address", (fields) -> 
    fields.field "lat", as: hidden 
    fields.field "lng", as: hidden 
    fields.field "street" 
    fields.field "city", as: "select", collection: ["CA"] 

...產生這樣的:

<form class='form' data-method='post' method='post' novalidate='true' role='form'> 
    <fieldset class='fieldset' id='profile'> 
    <legend class='legend'> 
     <span>Profile</span> 
    </legend> 
    <li class='field-list'> 
     <li class='field string optional validate'> 
     <label class='label' for='active-record-user-first-name-input'> 
      <span>First Name</span> 

...而不是這個:

<form class='form' data-method='post' method='post' novalidate='true' role='form'> 
    <fieldset class='fieldset' id='profile'> 
    <legend class='legend'> 
     <span>Profile</span> 
    </legend> 
    <ol class='field-list'> 
     <li class='field string optional validate'> 
     <label class='label' for='active-record-user-first-name-input'> 
      <span>First Name</span> 

我想我挑剔過<ol><ul>,但我剛開始使用塔評價鐵路和德比。這是咖啡壺問題還是薄荷味問題?

回答