【问题标题】:simple_form_for error: wrong number of arguments (3 for 2), in rails 3simple_form_for 错误:参数数量错误(3 代表 2),在 rails 3
【发布时间】:2023-03-08 10:40:01
【问题描述】:

rails 3 中 simple_form_for 标记的参数数量错误(3 对 2)错误(使用 haml)。 有趣的是,它在不久前运行良好。

= simple_form_for(:user,@user, :url => user_path, :remote => true, :html => { :id => "locate", :class=>"locateform" }) do |f

任何指针/帮助都会很棒。

谢谢

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 haml simple-form


    【解决方案1】:

    这部分看起来很可疑。

    :user,@user,
    

    您是否不小心删除了 :as => ?我觉得应该是

    :user, :as => @user
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多