【发布时间】:2011-06-19 04:30:10
【问题描述】:
我对 Ruby on Rails 非常陌生,甚至对 Haml 也很陌生,我在 2 小时前就开始使用它。所以我正在关注 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.'
【问题讨论】:
标签: ruby-on-rails-3 haml