form_for rails 4 中的参数数量错误 [英] form_for wrong number of arguments in rails 4

查看:22
本文介绍了form_for rails 4 中的参数数量错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 form_for 标签,它在 Rails 3.0.4 环境中工作.但是当我尝试将我的项目更新到 Rails 4.It 时出现以下错误

I am using form_for tag and Its working in Rails 3.0.4 environment. But when I tried to update my project to Rails 4.It gives following errors

参数数量错误(3 代表 2).这是我的代码

wrong number of arguments (3 for 2). Here is my code

   <%= form_for @email, :url => alerts_path do |f| %>
   <% end %>

推荐答案

我看不出你的 form_for 有任何问题,你能发布异常的回溯吗?可能是另一个 gem 覆盖了默认的 form_for ?

I can't see any issue with your form_for, can you post backtrace of exception ? may be another gem is overriding default form_for ?

这篇关于form_for rails 4 中的参数数量错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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