我正在尝试切换到使用 HAML 来查看我的视图,但我不断收到意外的 KENSURE 消息。我使用 html2haml 来切换工作视图文件。第一次运行它告诉我我不需要 html2haml 在其输出中的结尾,所以我删除了它,现在我得到的错误看起来像是在抱怨表单没有结束。
我究竟做错了什么?
错误信息:
compile error
app/views/sessions/new.html.haml:20: syntax error, unexpected kENSURE, expecting kEND
app/views/sessions/new.html.haml:22: syntax error, unexpected $end, expecting kEND
应用程序.html.haml:
!!!
%html
%head
%title
= APP_CONFIG[:site_name] + ': ' + @page_title
== <meta http-equiv="content-type" content="text/xhtml; charset=utf-8" />
== <meta http-equiv="imagetoolbar" content="no" />
== <meta name="distribution" content="all" />
== <meta name="robots" content="all" />
== <meta name="resource-type" content="document" />
== <meta name="MSSmartTagsPreventParsing" content="true" />
= stylesheet_link_tag 'base'
= javascript_include_tag :defaults
%body
#container
#header
- if logged_in?
= link_to 'Logout', logout_path
- else
= link_to 'Login', login_path
= link_to 'Signup', signup_path
#content
= flash_messages
= yield :layout
和 session/new.html.haml
= title "Login", :h2
- form_tag session_path do
%fieldset
%legend
Your Details
%ol
%li
= label_tag 'login', 'Username'
= text_field_tag 'login', @login
%li
= label_tag 'password'
= password_field_tag 'password', nil
%li
= label_tag 'remember_me', 'Remember me'
= check_box_tag 'remember_me', '1', @remember_me
.buttons
= submit_tag 'Login'
= link_to 'Forgotten Password', forgot_password_path