Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 表单标签的简单表单_Html_Css_Ruby On Rails_Forms_Simple Form - Fatal编程技术网

Html 表单标签的简单表单

Html 表单标签的简单表单,html,css,ruby-on-rails,forms,simple-form,Html,Css,Ruby On Rails,Forms,Simple Form,我遇到了一个奇怪的问题,简单表单没有创建标记,而是创建所有输入 我的代码如下所示: = simple_form_for @cost, url: cost_url, html: {remote:true, id: 'new_cost_form'} do |f| = f.input :name, placeholder: "Cost name" = f.input :factor, as: :text, :input_html => { 'rows'

我遇到了一个奇怪的问题,简单表单没有创建
标记,而是创建所有输入

我的代码如下所示:

= simple_form_for @cost, url: cost_url, html: {remote:true, id: 'new_cost_form'}  do |f|
          = f.input :name, placeholder: "Cost name"
          = f.input :factor, as: :text, :input_html => { 'rows' => 5}
          = f.input :is_default, as: :boolean, label: "Default"
该代码生成单个输入(使用专有名称),但页面上没有html
标记(我尝试在浏览器控制台
$(“#新的_成本_表单”)中执行)
,并且存在空数组


我错过了什么吗?我用这种方式创建了很多表单,但只有这种方式不起作用。

虽然我不完全确定,
remote:true
可能与表单的缺乏有关,因为它是用于ajax调用的。您已经标记了html,但您的代码是Haml。如果您使用html,请确保您已经正确关闭了所有标记。如果您使用的是Haml,那么您应该在使用
=
时看到表单标记。如果您发布完整表单,那么可能有人能够指出结果,在我的代码上有另一个表单,由于代码太多,我没有注意到,所以通过将我的代码移到表单标记之外来解决它