【发布时间】:2015-11-29 01:24:13
【问题描述】:
我正在学习制作论坛的教程!当我在 index.html.haml 中编写这段代码时
- @posts.each do |post|
%h2= post.title
%p
Published at
= time_ago_in_words(post.created_at)
= link_to "New Post", new_post_path
我收到了这个错误:
app/views/posts/index.html.haml:7:语法错误,意外的keyword_ensure,期待keyword_end
app/views/posts/index.html.haml:10:语法错误,意外的输入结束,期待关键字_end
我真的需要你的帮助!
【问题讨论】:
-
你知道 HAML 是基于缩进的,对吧?
标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-4 haml html2haml