我对Ruby on Rails非常陌生,对Haml更是一无所知,两个小时前我才开始使用它。我正在跟随一个Ruby on Rails的教程,并决定在视图中使用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.'