【问题标题】:Rails Simple Form error: No implicit conversion of Symbol into IntegerRails 简单形式错误:没有将符号隐式转换为整数
【发布时间】:2014-09-25 00:12:03
【问题描述】:

我有一个带有 Simple Form 和 Bootstrap 的 rails 4 应用程序。

我有一个表单,里面有两个字段,如下:

 <%= f.input :type, 'What sort of equipment or materials are you seeking?' %>
  <%= f.input :description, 'What are your project requirements for the equipment or materials?' %>

当我尝试查看表单时 - 我收到一条错误消息:'没有将符号隐式转换为整数)。

我没有任何似乎是其他人问题主题的数组。有谁知道问题出在哪里?

谢谢

【问题讨论】:

    标签: ruby-on-rails twitter-bootstrap simple-form


    【解决方案1】:

    第二个参数是一个哈希,而不是一个字符串。如果您希望您的字符串成为标签:

    <%= f.input :type, { label: 'What of equipment or materials are you seeking' } %>
    

    http://rubydoc.info/github/plataformatec/simple_form/master/SimpleForm/FormBuilder#input-instance_method

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多