2011-01-18 65 views
1
- if @likelist 
      You like 
      = @likelist.products.size 
      products. 
      = link_to "Likelist", likelist_path 

這導致難看的換行符 - >HAML換行符

 <div id='likelist_link'> 
     You like 
     1 
     products. 
     <a href="/likelist">Likelist</a> 
     </div> 

有沒有辦法在一行中得到的一切?

回答

6
- if @likelist 
    You like #{@likelist.products.size} products. #{link_to "Likelist", likelist_path}