Rails 3 client_side_validations 给出编译错误(我正在使用 devise)
使用 client_side_validations 时出现以下错误...我已将源代码放在下面..该表单并不复杂,它是我与 devise 一起使用的简单表单...有人可以帮我解决问题吗..
错误:
compile error
C:/project/madhu_ar/app/views/profiles/new.html.erb:2: syntax error, unexpected tASSOC, expecting kEND
...rm_for(@profile), :validate => true do |f| @output_buffer.sa...
^
C:/project/madhu_ar/app/views/profiles/new.html.erb:54: syntax error, unexpected kENSURE,
expecting $end
My Source is like this :
<h1>Business Profile Setup </h1>
<%= form_for(@profile), :validate => true do |f| %>
<div class="field">
<%= f.label :businessname %>
<br />
<%= f.text_field :businessname %>
</div>
<div class="field">
<%= f.label :addressline1 %>
<br />
<%= f.text_field :addressline1 %>
</div>
问候 马杜卡
I am getting the below error when using client_side_validations...I have put my source below.. The form is nothing complex, it is a simple form I am using with devise...Can someone help me what is the issue..
Error:
compile error
C:/project/madhu_ar/app/views/profiles/new.html.erb:2: syntax error, unexpected tASSOC, expecting kEND
...rm_for(@profile), :validate => true do |f| @output_buffer.sa...
^
C:/project/madhu_ar/app/views/profiles/new.html.erb:54: syntax error, unexpected kENSURE,
expecting $end
My Source is like this :
<h1>Business Profile Setup </h1>
<%= form_for(@profile), :validate => true do |f| %>
<div class="field">
<%= f.label :businessname %>
<br />
<%= f.text_field :businessname %>
</div>
<div class="field">
<%= f.label :addressline1 %>
<br />
<%= f.text_field :addressline1 %>
</div>
Regards
Madhukar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的右括号位于错误的位置,这:
应该是:
或只是:
form_for
帮助器希望对象作为第一个参数,选项哈希作为第二个参数;为什么说form_for(@profile), :validate => true
,您给form_for
它的第一个参数,然后在该方法调用后面加上逗号和符号,这是无效的语法。Your closing parenthesis is in the wrong place, this:
should be:
or just:
The
form_for
helper wants the object as the first argument and the options hash as the second; why sayform_for(@profile), :validate => true
, you're givingform_for
its first argument and then following that method call with a comma and a symbol and that's invalid syntax.