首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将piggybak与rails admin集成时出错。未定义的方法“nestable”

将piggybak与rails admin集成时出错。未定义的方法“nestable”
EN

Stack Overflow用户
提问于 2014-09-08 16:40:10
回答 1查看 274关注 0票数 1

我尝试将piggybak集成到我的rails应用程序中,使用rails_admin的示例初始化器

https://github.com/piggybak/demo/blob/master/config/initializers/rails_admin.rb

当我尝试启动服务器时,我得到以下错误:

/home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:32:in block (2 levels) in <top (required)>': undefined method嵌套‘for RailsAdmin::Config::Actions:Module (NoMethodError)

这是服务器日志:

代码语言:javascript
复制
/home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:32:in `block (2 levels) in <top (required)>': undefined method `nestable' for RailsAdmin::Config::Actions:Module (NoMethodError)
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:239:in `instance_eval'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin/config.rb:239:in `actions'
    from /home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:21:in `block in <top (required)>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin.rb:29:in `call'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rails_admin-0.6.3/lib/rails_admin.rb:29:in `config'
    from /home/dumand/Desktop/Projects/3dgreen/config/initializers/rails_admin.rb:1:in `<top (required)>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:418:in `block (2 levels) in each_strongly_connected_component_from'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:417:in `block in each_strongly_connected_component_from'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `call'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in `each_strongly_connected_component_from'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `call'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
    from /home/dumand/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/dumand/Desktop/Projects/3dgreen/config/environment.rb:5:in `<top (required)>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
    from /home/dumand/Desktop/Projects/3dgreen/config.ru:3:in `block in <main>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from /home/dumand/Desktop/Projects/3dgreen/config.ru:in `new'
    from /home/dumand/Desktop/Projects/3dgreen/config.ru:in `<main>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
    from /home/dumand/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

下面是rails_admin初始化器:

代码语言:javascript
复制
RailsAdmin.config do |config|

  config.main_app_name = ["3D Green"]

  ### Popular gems integration

  ## == Devise ==
  # config.authenticate_with do
  #   warden.authenticate! scope: :user
  # end
  # config.current_user_method(&:current_user)

  ## == Cancan ==
  # config.authorize_with :cancan

  ## == PaperTrail ==
  # config.audit_with :paper_trail, 'User', 'PaperTrail::Version' # PaperTrail >= 3.0.0

  ### More at https://github.com/sferik/rails_admin/wiki/Base-configuration

  config.actions do
    dashboard                     # mandatory
    index                         # mandatory
    new
    export
    bulk_delete
    show
    edit
    delete
    show_in_app

   nestable do
    visible do
      [::PiggybakTaxonomy::NavigationNode].include? bindings[:abstract_model].model
    end
   end

    ## With an audit adapter, you can add:
    # history_index
    # history_show

    config.model Product do
      edit do
      include_all_fields
      end
    end

  end
end
EN

回答 1

Stack Overflow用户

发布于 2015-08-05 10:45:17

尝试删除可嵌套的分类代码,因为您似乎也没有按照模型使用嵌套分类

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25720293

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档