rails表单错误:语法错误,意外的keyword_ensure,期望输入结束 [英] rails form error: syntax error, unexpected keyword_ensure, expecting end-of-input

查看:331
本文介绍了rails表单错误:语法错误,意外的keyword_ensure,期望输入结束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道问题是什么。当我使用表单进入页面时,我会收到错误:

 语法错误,意外的keyword_ensure,输入

以下是我的表单代码:

 <%= form_tag({controller::skills,action::update},:method =>:put,
:class =>skill- form,:remote => true)do%>

<%= select_tag:label,
options_for_select(@ crafts.c​​ollect {| craft | [craft.label,craft.label]}),
include_blank:true, :id => 'selectme',
:class => 'field field288 selected - 选择'%>

<%= submit_tagADD +,:id => clickme,:class => '按钮'%>

<%end%>


解决方案

form_tag中删除空格

 <%= form_tag({controller::skills,action::update} :method =>:put,
:class =>skill-form,:remote => true)do%>


I can't figure out what the problem is. When I go to the page with the form on it, i get the error:

syntax error, unexpected keyword_ensure, expecting end-of-input

Here is my form code:

<%= form_tag ({controller: :skills, action: :update}, :method => :put, 
    :class => "skill-form", :remote => true) do  %>

    <%= select_tag :label,
       options_for_select( @crafts.collect {|craft| [craft.label, craft.label]}),
       include_blank: true,  :id => 'selectme', 
       :class => 'field field288 chosen-select' %>

    <%= submit_tag "ADD +", :id => "clickme", :class => 'button' %>

<% end %>

解决方案

Remove space from your form_tag:

<%= form_tag({controller: :skills, action: :update}, :method => :put, 
    :class => "skill-form", :remote => true) do  %>

这篇关于rails表单错误:语法错误,意外的keyword_ensure,期望输入结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆