我有一個配置文件充滿了這個....哈姆語法 - 更好的寫作方式?
- if current_page.include? "test_string_one"
- @total_index = 3
- @next_location = '../random_string/page0.html'
- @next_name = 'title 2'
- if current_page.include? "test_string_two"
- @total_index = 10
- @next_location = '../another_random_string/page0.html'
- @next_name = 'title 3'
有沒有寫這個的更清潔的方式?使用Staticmatic。
我看到haml中有可用的過濾器。這一切應該在:ruby
過濾器?
Dup的http://stackoverflow.com/questions/1743291/haml-syntax-better-way-of-writing-this – 2009-11-16 18:11:23