7
我對Ruby on Rails很新,甚至對Haml更新,我在2個小時前開始使用它。所以我正在遵循Ruby on Rails教程,並決定在視圖上使用Haml,但我不確定這是否是顯示事物的正確方法(感覺有點奇怪)。有人能啓發我嗎? :)這是使用Haml顯示/連接文本的正確方法嗎?
%h1= "About Us"
%p
=link_to 'Ruby on Rails Tutorial','http://railstutorial.org'
&= 'is a project to make a book and screencasts to teach web development with'
&= link_to 'Ruby on Rails', 'http://rubyonrails.org'
&= '. This is the sample application for the tutorial.'
我已經試過這太:
:ruby
first_link = link_to 'Ruby on Rails Tutorial','http://railstutorial.org'
second_link = link_to 'Ruby on Rails', 'http://rubyonrails.org'
%h1= "About Us"
%p
= first_link
&= 'is a project to make a book and screencasts to teach web development with'
&= second_link
&= '. This is the sample application for the tutorial.'
完美答案,非常感謝。 :) –