Tôi rất mới với Ruby on Rails, và thậm chí mới hơn với Haml, tôi bắt đầu sử dụng nó 2 giờ trước. Vì vậy, tôi đang theo một hướng dẫn Ruby on Rails và quyết định sử dụng Haml trên quan điểm, nhưng tôi không chắc chắn nếu đây là cách chính xác để hiển thị mọi thứ (nó cảm thấy kinda lạ). Ai đó có thể khai sáng cho tôi? :)Đây có phải là cách chính xác để hiển thị/ghép nối văn bản bằng Haml không?
%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.'
Tôi đã thử này quá:
: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.'
Câu trả lời hoàn hảo, cảm ơn bạn rất nhiều. :) –