活动管理员:会话中的ArgumentError #new(Rails 4.1.0.beta1)

时间:2014-01-02 22:01:02

标签: ruby-on-rails ruby-on-rails-4 activeadmin

Active Admin在使用edge Rails(4.1.0.beta1)进行全新安装时给出了以下错误

ArgumentError in ActiveAdmin::Devise::Sessions#new
wrong number of arguments (5 for 4)

Extracted source (around line #5):
<%= active_admin_form_for(resource, :as => resource_name, :url => send(:"#{scope}_session_path"), :html => { :id => "session_new" }) do |f|

的Gemfile:

gem 'polyamorous', github: 'activerecord-hackery/polyamorous', branch: 'rails-4.1'
gem 'activeadmin', github: 'gregbell/active_admin'

3 个答案:

答案 0 :(得分:3)

我也遇到了这个问题。

这种情况正在发生,因为Rails 4.1从block构造函数中删除了第五个参数ActionView::Helpers::FormBuilder

在formtastic master中有一个补丁来解决这个问题。您可以在Gemfile中使用gem "formtastic", github: "justinfrench/formtastic"

答案 1 :(得分:3)

通过从我的Gemfile中删除 gem“meta_search”来让我的工作。

答案 2 :(得分:0)

你可以尝试的第一件事是更新设备到最新的主人,似乎设计好的人在rails 4.1兼容性上做了一些工作 - 19小时前有Merge pull request #2822 from plataformatec/rails-4.1拉请求合并,https://github.com/plataformatec/devise/commits/master

如果失败那么答案是“不要使用边缘轨道”,根据AAs提交历史记录,没有完成使用边缘轨道工作的工作,人们会认为至少需要稍微调整一下,考虑到4.1 beta1发布就在假期前https://github.com/gregbell/active_admin/commits/master

,AA的优秀人才很有可能根本无法做到这一点
相关问题