Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/66.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
Ruby on rails 斯利姆:什么';这些数据属性有什么问题?_Ruby On Rails_Ruby_Slim Lang - Fatal编程技术网

Ruby on rails 斯利姆:什么';这些数据属性有什么问题?

Ruby on rails 斯利姆:什么';这些数据属性有什么问题?,ruby-on-rails,ruby,slim-lang,Ruby On Rails,Ruby,Slim Lang,在以下代码中: p = f.email_field :email, data: { toggle: 'popover', placement: 'right', trigger: 'manual', html: 'true' }, autofocus: true, placeholder: 'Email address' 我不断收到一个错误,预期的标签靠近切换:“popover” 我做错了什么?这不是在Slim中指

在以下代码中:

p = f.email_field :email,
    data: {
      toggle: 'popover',
      placement: 'right',
      trigger: 'manual',
      html: 'true'
    },
    autofocus: true,
    placeholder: 'Email address'
我不断收到一个错误,
预期的标签靠近切换:“popover”


我做错了什么?这不是在Slim中指定数据属性的正确方法吗?

此处的缩进错误,因为电子邮件字段与p标记一起写入一行。这应该起作用:

p
  = f.email_field :email, data: { toggle: 'popover', placement: 'right',
    trigger: 'manual', html: 'true' }, autofocus: true, placeholder: 'Email address'

这里的缩进是错误的,因为email字段与p标记写在一行中。这应该起作用:

p
  = f.email_field :email, data: { toggle: 'popover', placement: 'right',
    trigger: 'manual', html: 'true' }, autofocus: true, placeholder: 'Email address'

如果实际代码的格式与此处的格式完全相同,那么问题可能是硬返回。在Slim中,空格和回车/换行符与代码的解释方式有关


我会尝试将所有内容都放在一行上,看看这是否解决了问题。

如果您的实际代码的格式与此处的格式完全相同,那么问题可能是硬返回。在Slim中,空格和回车/换行符与代码的解释方式有关


我会尝试将所有内容保持在一条线上,看看这是否解决了问题。

似乎不是这样——它仍在抛出相同的消息。我想是数据属性数组的问题。我更新了答案。你能试试看它是否对你有用吗?似乎不是这样——它仍然传递着同样的信息。我想是数据属性数组的问题。我更新了答案。你能试试看它是否对你有用吗?