我同时使用formtastic和devise,但遇到使devise错误在表单中内联显示的问题。
我尝试使用此Stack Overflow post中的代码,但出现以下错误:
syntax error, unexpected keyword_ensure, expecting end-of-input
这是我正在尝试的代码:
= semantic_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
%fieldset
.section--sm
.highlight--secondary-division
.highlight--secondary
%legend.highlight--secondary-text.text-header--large.text-sans--a Or Use Your Email Account
= devise_error_messages!
- flash.each do |key, value|
.flash= key value
= f.inputs do
= f.input :email, label: 'Email Address', input_html: { autofocus: true }, wrapper_html: { class: " division--top autofill-border" }
= f.input :password, input_html: { autocomplete: 'off' }
= f.actions do
.section--xs
= f.action :submit, label: 'Log In', button_html: { class: "button--secondary" }
感谢您的帮助和建议!