GithubHelp home page GithubHelp logo

activeadmin / activeadmin-mongoid Goto Github PK

View Code? Open in Web Editor NEW
192.0 192.0 211.0 436 KB

ActiveAdmin hacks to support Mongoid

License: MIT License

Ruby 86.62% JavaScript 0.99% CSS 0.68% HTML 10.28% SCSS 1.42%

activeadmin-mongoid's People

Contributors

anatolyshirykalov avatar arturictus avatar boie0025 avatar claster avatar daniel-g avatar danielvartanov avatar deivid-rodriguez avatar dependabot[bot] avatar elia avatar grzegorz-jakubiak avatar jandudulski avatar lukaso avatar matekb avatar navdevl avatar pencilcheck avatar potatosalad avatar proxygear avatar timoschilling avatar trekdemo avatar xfynx avatar zhomart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activeadmin-mongoid's Issues

method_missing: undefined method `active_record'

When I try to execute

$ rails g devise:install

It returns the errors:

/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.11/lib/rails/railtie/configuration.rb:85:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x007fc6cbc2b6d8> (NoMethodError)

Any idea?

Error with Rails 4

Hello, I was happy to find a mongoid version of ActiveAdmin, but now I get the following error, when trying to bundle my Gemfile:

Bundler could not find compatible versions for gem "mongoid":
  In Gemfile:
    activeadmin-mongoid (>= 0) ruby depends on
      mongoid (~> 4.0) ruby

    mongoid (4.0.0.beta1)

Document has_many and belongs_to error undefined method `programs_id_eq' for #<MetaSearch::Searches::MongoidSearchBuilder:0x007f388084da40>

So, I used

gem 'mongoid'
gem 'carrierwave-mongoid', :require => 'carrierwave/mongoid'
gem 'activeadmin-mongoid', '~> 0.3.0'

The mongoid version is 3.1.5. I have two models GroupProgram and Program. The relation is simple GroupProgram has_many Program and Program belongs_to GroupProgram. here is the code

class GroupProgram
  include Mongoid::Document
  include Mongoid::Timestamps

  field :title, type: String
  field :description, type: String
  has_many :programs

  attr_accessible :title, :description, :programs
end
class Program
  include Mongoid::Document
  include Mongoid::Timestamps

  field :title, type: String
  field :description, type: String
  belongs_to :group_program

  # todo add image uploader
end

Okay, the http://127.0.0.1:3000/admin/group_programs URL give me errors NoMethodError at /admin/group_programs
undefined method `programs_id_eq' for #<MetaSearch::Searches::MongoidSearchBuilder:0x007f388084da40.

undefined method `accessible_by' for ModelName:Class

Hello! I have a problem on activeadmin with mongoid plugin. It's problem only on mongoid models + cancan roles. Rayanb manual (https://github.com/ryanb/cancan/wiki/Mongoid) not work in this case.

NoMethodError in Admin::ModelNameController#index
undefined method `accessible_by' for ModelName:Class
gem 'rails'
gem 'devise'
gem 'activeadmin',         github: 'gregbell/active_admin'
gem 'activeadmin-mongoid', github: 'elia/activeadmin-mongoid', branch: 'rails4'
gem 'mongo'
gem 'mongoid'

gem 'cancan'

versions:

  • Rails 4.1.0
  • CanCan 1.6.10
  • Mongoid 4.0.0.beta1
  • ActiveAdmin (1.0.0.pre)
  • activeadmin-mongoid (0.2.1)

Selecting embedded relations possible?

Is it possible to use select boxes to select the parent document?

ActiveAdmin.register Embedded do
  # [snip]

  form :html do
    f.inputs do
      f.input :embedder, :as => :select
    end
  end
end

Does not work.

Problem with relations

The is a small problem with relations. For example I have the following Product and Group models:

class Product
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name, :type => String
  field :description, :type => String
  field :price, :type => Float

  belongs_to :group
end

class Group
  include Mongoid::Document
  include Mongoid::Timestamps

  field :name, :type => String

  has_many :products
end

When I open product's form for group I see regular text field in which I have to provide a valid group id.
When I override a product's form:

ActiveAdmin.register Product do

  form do |f|
    f.inputs do
      f.input :name
      f.input :description, :as => :text
      f.input :price
      f.input :group
    end

    f.buttons
  end

end

then I can use select box for selecting a group.

Any plans to support embedded documents with activeadmin's f.has_many form helper?

This gem has been a big help to me, but the only thing keeping me from using it on every project is that there are often cases where it makes sense and improves performance to embed a set of related documents with embeds_many instead of relating them with has_many, but doing so makes it impossible (it seems) to use activeadmin's super-handy f.has_many form helper.

Am I wrong and it's possible, or are there plans to support this feature in the future?

Can't create an Admin

-- UPDATE:
Sorry, I forget I had an attributes whitelist.

AdminUser.create(:email => '[email protected]', :password => 'password', :password_confirmation => 'password')

returns

AdminUser _id: 508e5a9a2f412e0aa6000002, _type: nil, email: "", encrypted_password: "", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 0, current_sign_in_at: nil, last_sign_in_at: nil, current_sign_in_ip: nil, last_sign_in_ip: nil

So the document cannot be saved as it has empty email and password.

Rails 4.0.0

get this errors with rails 4.0.0 and mongoid 4.0.0

gem 'activeadmin-mongoid',  git: 'git://github.com/elia/activeadmin-mongoid.git'
Bundler could not find compatible versions for gem "sass-rails":
  In Gemfile:
    activeadmin-mongoid (>= 0) ruby depends on
      sass-rails (>= 3.1.4, ~> 3.1) ruby
    sass-rails (4.0.0)

Using version 0.0.1, cannot implement "Login as user" behaviour

I don't think this is really an issue, as I'm using a very old version of activeadmin-mongoid, and can't currently update it for various reasons. However, I've tried to implement the changes outlined in these two Devise Wiki articles to add "Login as user" behaviour:

https://github.com/plataformatec/devise/wiki/How-To:-Using-ActiveAdmin-to-login-as-any-user (Died on a warden serialize call, using warden 1.2.1)
https://github.com/plataformatec/devise/wiki/How-To:-Sign-in-as-another-user-if-you-are-an-admin (Gave a controller error)

As well as using the switch_user gem to implement the feature. None of the errors I was getting were documented anywhere, and I'm assuming thats because people are using the up to date version. My question is: is it possible to implement the "login as user" feature with my current version of activeadmin-mongoid (0.0.1), or will I need to update it?

Again, I'm really sorry if this isn't worthy of a new issue(it probably isn't), I'm just sort of stuck as to where to go with this, and I don't want to keep spinning my wheels if it isn't possible without the latest activeadmin-mongoid version.

NoMethodError (undefined method `new' for TrueClass:Class)

I have a Hash field on my document and I'm trying to persist it from request params:

Parameters: {... "add"=>"{ "street" : "900 Broad
way", "city" : "Seattle", "formattedAddress" : "900 Broadway, Seattle, WA, United States", "state" : "WA", "latitude" : "47.6111", "country" :
"United States", "longitude" : "-122.3197", "zip" : "98102", "mode" : "Manual" }"}}

If I directly do a new using the above, it treats the "add" string as a String and complains that it doesn't have the update_values method.

So I convert that parameter to a hash by:

if params[:add]
    ad = params[:add]
    params[:add] = JSON.parse(ad)
end

which results in:

{... "add"=>{"street"=>"900 Broadway", "city"=>"Seattle", "formattedAd
dress"=>"900 Broadway, Seattle, WA, United States", "state"=>"WA", "latitude"=>"47.6111", "country"=>"United States", "longitude"=>"-122.3197", "zip"=>"98102", "mode"=>"Manu
al"}}

and then do a .new with the params.

Now it complains saying:
NoMethodError (undefined method `new' for TrueClass:Class):

How does one ever persist Hash fields on mongoid documents?

Tutorial?

Could you provide more information on how to get this up and going? For example, I've run into errors when trying to install active admin. When I add ActiveAdmin.routes(self), I just get an error that no active record connection could be found.

-Mario

Problems with dependency of the new and old jquery-rails and jquery-ui-rails

activeadmin 0.6 depends on jquery-rails > 1.0.0 because at that time I believe they didn't foresee the change that refactor jquery-ui out into its own gem, but ironically activeadmin-mongoid depends on activeadmin ~> 0.6 and at the same time jquery-rails >= 3.0.0 and jquery-ui-rails >= 4.0.0, so when I run rails it will keep telling me that jquery-ui file is not found because activeadmin-0.6 is still using the old syntax to include jquery-ui and I can't include two versions of jquery-rails at the same time...

This issue has been giving me a lot of headaches, because if I upgrade to activeadmin 0.6.1 then formtastics will have problem with mongoid saying that method reflections is not found for Whatever:Class and the author of formtastics explicitly stated that he is not interested in supporting mongo db as seen in this issue (formtastic/formtastic#286).

So I'm stuck between this dependency hell, and I can't get out of it. And please don't tell me to upgrade to rails 4 (using rails 3.2.13 currently).

So please have mercy and remove that jquery-rails version dependency for activeadmin-mongoid or have a version to support older jquery-rails but not too archiac thanks (the last version is 0.0.2 which is over 1 year old).

Using activeadmin-mongoid and mongoid_slug

I have following model:

class Category
  include Mongoid::Document
  include Mongoid::Slug

  #title
  field :title, :type => String
  validates :title, :uniqueness => {:scope => :parent}, presence: true

  slug :title

end

For regular controllers i have urls like /categories/the-category-slug/, so lookup of Category object is different: Category.find_by_slug (params [: id]). How do I get to select Category by slug and not by id.

Sorry for my bad English.

admin_users

I'm trying to test activeadmin-mongoid so i just added the gem, bundled, and generated the active_admin:install and deleted the migrations created. But how can i simply add in the collection admin_users the credentials needed to sign in the /admin ?

rails & meta_search gems depend on activerecord!

My Gemfile.lock states that activerecord is required by meta_search and rails.
Whenever I do any rails generate, it breaks due to ActiveRecord connection not established!
I created the rails app with --skip-active-record and using mongoid.
Rails version 3.2.11, also tried 3.2.
Tried locking activeadmin-mongoid to ~> 2.0

Incorrect find query is used for Mongoid embedded documents

Hi,

I'm using activeadmin-mongoid with Rails 3.2.13 and Mongoid 3.1.4, and I'm trying to view an embedded document in the admin interface, but I get Document(s) not found for class ApiApplication with id(s) 51dcba...

I have a User resource that embeds_many api_applications, and it looks like activeadmin-mongoid is using ApiApplication.find, but in Mongoid, that won't work. If a User embeds_many api_applications, you have to do user.api_applications.find(id)

My admin/users.rb show snippet:

show :title => :name do |user|
  attributes_table do
    row :name
    row :email
  end

  panel "API Applications" do
    table_for user.api_applications do |t|
      t.column("Name") do |api_application|
        link_to api_application.name,
          admin_user_api_application_path(user, api_application)
      end
    end
  end
end

My admin/api_applications.rb has this:

ActiveAdmin.register ApiApplication do
  belongs_to :user
  ...

When I view the show page for a particular user, it is displaying the correct ApiApplication for that user, but when I click on the link that should take me to the show view for the ApiApplication, I get that document not found error.

Note that this works fine if I use has_many and belongs_to in my Mongoid models instead.

Is this a known issue with embedded documents?

Error on show view

Hi there,
I got a problem when developing with activeadmin-mongoid. So, everythings fine, but now I wanted to create a new Booking (my model name) and then I got the following error:

[:_id] is not a symbol

I tried to edit, that the _id should not be shown on the show page, but it also does not help.

The entire trace:

/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/view_helpers/display_helper.rb:8:in `block in <module:DisplayHelper>'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/view_helpers/method_or_proc_helper.rb:86:in `instance_exec'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/view_helpers/method_or_proc_helper.rb:86:in `render_in_context'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/view_helpers/display_helper.rb:18:in `display_name'
arbre (1.0.1) lib/arbre/element.rb:175:in `method_missing'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/views/pages/show.rb:36:in `default_title'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/views/pages/show.rb:14:in `title'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/views/pages/base.rb:25:in `block in build_active_admin_head'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/views/pages/base.rb:24:in `build_active_admin_head'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/lib/active_admin/views/pages/base.rb:9:in `build'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/app/views/active_admin/resource/show.html.arb:1:in `block in ___sers_dschmidt__rbenv_versions_______p____lib_ruby_gems_______bundler_gems_active_admin_fdc_a_d_faee_app_views_active_admin_resource_show_html_arb___757245983050418369_70286301542840'
arbre (1.0.1) lib/arbre/context.rb:45:in `instance_eval'
arbre (1.0.1) lib/arbre/context.rb:45:in `initialize'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/app/views/active_admin/resource/show.html.arb:1:in `new'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-fdc6a3d9faee/app/views/active_admin/resource/show.html.arb:1:in `___sers_dschmidt__rbenv_versions_______p____lib_ruby_gems_______bundler_gems_active_admin_fdc_a_d_faee_app_views_active_admin_resource_show_html_arb___757245983050418369_70286301542840'
actionview (4.1.0) lib/action_view/template.rb:145:in `block in render'
activesupport (4.1.0) lib/active_support/notifications.rb:161:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:339:in `instrument'
actionview (4.1.0) lib/action_view/template.rb:143:in `render'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:55:in `block (2 levels) in render_template'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionview (4.1.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:54:in `block in render_template'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:62:in `render_with_layout'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:53:in `render_template'
actionview (4.1.0) lib/action_view/renderer/template_renderer.rb:17:in `render'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (4.1.0) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (4.1.0) lib/action_view/rendering.rb:99:in `_render_template'
actionpack (4.1.0) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (4.1.0) lib/action_view/rendering.rb:82:in `render_to_body'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:32:in `render_to_body'
actionpack (4.1.0) lib/action_controller/metal/renderers.rb:32:in `render_to_body'
actionpack (4.1.0) lib/abstract_controller/rendering.rb:25:in `render'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
activesupport (4.1.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
activesupport (4.1.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (4.1.0) lib/action_controller/metal/implicit_render.rb:10:in `default_render'
actionpack (4.1.0) lib/action_controller/metal/responder.rb:238:in `default_render'
actionpack (4.1.0) lib/action_controller/metal/responder.rb:165:in `to_html'
responders (1.0.0) lib/responders/flash_responder.rb:104:in `to_html'
actionpack (4.1.0) lib/action_controller/metal/responder.rb:158:in `respond'
actionpack (4.1.0) lib/action_controller/metal/responder.rb:151:in `call'
actionpack (4.1.0) lib/action_controller/metal/mime_responds.rb:400:in `respond_with'
inherited_resources (1.4.1) lib/inherited_resources/actions.rb:13:in `show'
actionpack (4.1.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.1.0) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.1.0) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:113:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:229:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:166:in `block in halting'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `call'
activesupport (4.1.0) lib/active_support/callbacks.rb:86:in `run_callbacks'
actionpack (4.1.0) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.1.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.1.0) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.1.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.1.0) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
actionpack (4.1.0) lib/abstract_controller/base.rb:136:in `process'
actionview (4.1.0) lib/action_view/rendering.rb:30:in `process'
actionpack (4.1.0) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.1.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.1.0) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.1.0) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.1.0) lib/action_dispatch/routing/route_set.rb:676:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/flash.rb:254:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/cookies.rb:560:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.1.0) lib/active_support/callbacks.rb:82:in `run_callbacks'
actionpack (4.1.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.0) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.0) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.0) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.1.0) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.0) lib/rails/engine.rb:514:in `call'
railties (4.1.0) lib/rails/application.rb:144:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/dschmidt/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

Jquery Rails raising an issue

Hi,

I am using Activeadmin-Mongoid with Gmap rails.

I am facing issues with Jquery-rails gem. Either of gem throws error while using Active admin.

In my investigation the active admin uses "Jquery-rails(2.3.0)". But the Gmap rails uses latest version.

Can you please check the issue and help out in this case.

Thanks in advance

Doesn't work with Mongoid 3

Bundler could not find compatible versions for gem "mongoid":
  In Gemfile:
    activeadmin-mongoid (>= 0) ruby depends on
      mongoid (~> 2.0) ruby

    mongoid (3.0.5)

Localization bug in menu, breadcrumbs, title

In my locale file I have:

ru:
  mongoid:
    models:
      admin_user: ะะดะผะธะฝ
      page: ะกั‚ั€ะฐะฝะธั†ะฐ
      photo: ะคะพั‚ะพ
      work_item: ะ’ะธะด ั€ะฐะฑะพั‚
    attributes:
      work_item:
        work_type: ะ’ะธะด ัƒัะปัƒะณ
        name: ะะฐะธะผะตะฝะพะฒะฐะฝะธะต
      photo:
        title: ะŸั€ะธะผะตั‡ะฐะฝะธะต
        image: ะคะฐะนะป ั ั„ะพั‚ะพะณั€ะฐั„ะธะตะน

It work great, but header menu, breadcrumbs, system buttons ( Add ..., Edit ... tried to use ru.activerecord.models.*.

I can fix it with duplicating locale data for active record:

ru:
  activerecord:
    models:
      admin_user: ะะดะผะธะฝ
      page: ะกั‚ั€ะฐะฝะธั†ะฐ
      photo: ะคะพั‚ะพ
      work_item: ะ’ะธะด ั€ะฐะฑะพั‚

But I think that is not so good. I tried to find the bug in the source code, but I found none.

undefined method `' for #<MyModel>

The following line in attributes_table.rb (https://github.com/gregbell/active_admin/blob/master/lib/active_admin/views/components/attributes_table.rb)

  def find_attr_value(attr)
    attr.is_a?(Proc) ? attr.call(@record) : @record.send(attr.to_s.gsub(/_id\z/,''))
  end

causes a problem with activeadmin-mongoid - as one of the MongoDB columns is called '_id', this bit: attr.to_s.gsub(/_id\z/,'') returns an empty string. This causes the following error when attempting to view for a model which doesn't have a show block defined:

NoMethodError in /my_model#show

Showing /Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/app/views/active_admin/resource/show.html.arb where line #1 raised:

undefined method `' for #<MyModel:0x007fbd782ba010>
Extracted source (around line #1):

1: insert_tag renderer_for(:show)

Select Filter doesn't work on static valued /non Mongoid field

I'm trying to add a drop down filter on a custom field with static values.

filter :operation, :as => :select, :collection => ["min", "max"]

Here, 'operation' is not a 'field' in my registered Mongoid model.

I get an error with the following stack trace:

ActionView::Template::Error (undefined method `operation_eq' for #MetaSearch::Searches::MongoidSearchBuilder:0x007f8f7be2a420):
1: insert_tag renderer_for(:index)

I'm on latest master branch of this repo. I guess MetaSearch creates the dynamic '_eq' methods only on Mongoid fields. When I try a 'select' on a model field, it works well. This used to work on mongoid 2.x. Any pointers on how to fix it?

Moped::Errors::QueryFailure in Admin::DashboardController#index on rails4 branch

I'm hitting a Mongoid query error as soon as I log in to the admin dashboard. Here is the error in full:

Started GET "/admin" for 127.0.0.1 at 2014-05-07 13:40:21 -0400
Processing by Admin::DashboardController#index as HTML
  MOPED: 127.0.0.1:27017 QUERY        database=unifeed20_development collection=admin_users selector={"$query"=>{"_id"=>{"$oid"=>BSON::ObjectId('536a6a0e476f779ecb000000')}}, "$orderby"=>{:_id=>1}} flags=[] limit=-1 skip=0 batch_size=nil fields=nil runtime: 0.7600ms
Completed 500 Internal Server Error in 2ms

Moped::Errors::QueryFailure (The operation: #<Moped::Protocol::Query
  @length=132
  @request_id=8
  @response_to=0
  @op_code=2004
  @flags=[]
  @full_collection_name="unifeed20_development.admin_users"
  @skip=0
  @limit=-1
  @selector={"$query"=>{"_id"=>{"$oid"=>BSON::ObjectId('536a6a0e476f779ecb000000')}}, "$orderby"=>{:_id=>1}}
  @fields=nil>
failed with error 10068: "invalid operator: $oid"

See https://github.com/mongodb/mongo/blob/master/docs/errors.md
for details about this error.):
  moped (2.0.0.rc1) lib/moped/operation/read.rb:50:in `block in execute'
  moped (2.0.0.rc1) lib/moped/node.rb:594:in `[]'
  moped (2.0.0.rc1) lib/moped/node.rb:594:in `block (2 levels) in flush'
  moped (2.0.0.rc1) lib/moped/node.rb:593:in `map'
  moped (2.0.0.rc1) lib/moped/node.rb:593:in `block in flush'
  moped (2.0.0.rc1) lib/moped/node.rb:617:in `block in logging'
  activesupport (4.1.1) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.1) lib/active_support/notifications.rb:159:in `instrument'
  moped (2.0.0.rc1) lib/moped/instrumentable.rb:31:in `instrument'
  moped (2.0.0.rc1) lib/moped/node.rb:616:in `logging'
  moped (2.0.0.rc1) lib/moped/node.rb:587:in `flush'
  moped (2.0.0.rc1) lib/moped/node.rb:391:in `process'
  moped (2.0.0.rc1) lib/moped/operation/read.rb:48:in `execute'
  moped (2.0.0.rc1) lib/moped/node.rb:648:in `read'
  moped (2.0.0.rc1) lib/moped/node.rb:411:in `query'
  moped (2.0.0.rc1) lib/moped/query.rb:128:in `block in first'
  moped (2.0.0.rc1) lib/moped/cluster.rb:243:in `block in with_primary'
  moped (2.0.0.rc1) lib/moped/node.rb:204:in `block in ensure_primary'
  moped (2.0.0.rc1) lib/moped/executable.rb:25:in `execute'
  moped (2.0.0.rc1) lib/moped/node.rb:203:in `ensure_primary'
  moped (2.0.0.rc1) lib/moped/cluster.rb:242:in `with_primary'
  moped (2.0.0.rc1) lib/moped/read_preference/primary.rb:55:in `block in with_node'
  moped (2.0.0.rc1) lib/moped/read_preference/selectable.rb:65:in `call'
  moped (2.0.0.rc1) lib/moped/read_preference/selectable.rb:65:in `with_retry'
  moped (2.0.0.rc1) lib/moped/read_preference/primary.rb:54:in `with_node'
  moped (2.0.0.rc1) lib/moped/query.rb:127:in `first'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/query_cache.rb:187:in `block in first_with_cache'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/query_cache.rb:135:in `with_cache'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/query_cache.rb:186:in `first_with_cache'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/contextual/mongo.rb:199:in `block (2 levels) in first'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/contextual/mongo.rb:535:in `with_sorting'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/contextual/mongo.rb:198:in `block in first'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/contextual/mongo.rb:447:in `try_cache'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/contextual/mongo.rb:197:in `first'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlermongoid (e93a4837b026) lib/mongoid/contextual.rb:20:in `first'
  orm_adapter (0.5.0) lib/orm_adapter/adapters/mongoid.rb:22:in `get'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlerdevise (f611b6306949) lib/devise/models/authenticatable.rb:208:in `serialize_from_session'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlerdevise (f611b6306949) lib/devise.rb:466:in `block (2 levels) in configure_warden!'
  warden (1.2.3) lib/warden/session_serializer.rb:34:in `fetch'
  warden (1.2.3) lib/warden/proxy.rb:212:in `user'
  warden (1.2.3) lib/warden/proxy.rb:318:in `_perform_authentication'
  warden (1.2.3) lib/warden/proxy.rb:127:in `authenticate!'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundlerdevise (f611b6306949) lib/devise/controllers/helpers.rb:50:in `authenticate_admin_user!'
  /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/bundleractive_admin (85726865440b) lib/active_admin/base_controller.rb:40:in `authenticate_active_admin_user'
  activesupport (4.1.1) lib/active_support/callbacks.rb:424:in `block in make_lambda'
  activesupport (4.1.1) lib/active_support/callbacks.rb:160:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:160:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:229:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:229:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:166:in `block in halting'
  activesupport (4.1.1) lib/active_support/callbacks.rb:86:in `call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:86:in `run_callbacks'
  actionpack (4.1.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.1.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.1.1) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.1.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.1.1) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.1.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.1.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  actionpack (4.1.1) lib/abstract_controller/base.rb:136:in `process'
  actionview (4.1.1) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.1.1) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.1.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.1.1) lib/action_controller/metal.rb:231:in `block in action'
  actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:80:in `call'
  actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
  actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:48:in `call'
  actionpack (4.1.1) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.1.1) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.1.1) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.1.1) lib/action_dispatch/routing/route_set.rb:676:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/flash.rb:254:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.1.1) lib/active_support/callbacks.rb:82:in `run_callbacks'
  actionpack (4.1.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.1.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.1.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.1.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.1.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.1.1) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.1.1) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.1.1) lib/action_dispatch/middleware/static.rb:64:in `call'
  rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
  railties (4.1.1) lib/rails/engine.rb:514:in `call'
  railties (4.1.1) lib/rails/application.rb:144:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
  /Users/gowie/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
  /Users/gowie/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
  /Users/gowie/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'


  Rendered /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.5ms)
  Rendered /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.0ms)
  Rendered /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
  Rendered /Users/gowie/.rvm/gems/ruby-2.1.1@unifeed2/gems/actionpack-4.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (13.8ms)

Relevant part of my Gemfile:

gem 'mongoid', github: 'mongoid/mongoid', branch: 'master'

gem 'activeadmin',         github: 'gregbell/active_admin'
gem 'activeadmin-mongoid', github: 'elia/activeadmin-mongoid', branch: 'rails4'

gem 'rails', '4.1.1'

I've also tried adding devise's master branch before AA and and AA-mongoid, which didn't fix the issue.

Seems to be an issue with querying the user via ID from the Devise side. Any idea on a fix?

Rails 4?

I've been trying to use the master branch of Mongoid, which only supports Rails 4. This took me down the dependency rabbit hole... The activeadmin-mongoid gemspec does specify 'mongoid', '> 3.0', '< 5.0'. But it also specifies 'meta_search', '~> 1.1.3'. meta_search does not support Rails 4. In fact it is no longer being maintained. So I can't even bundle.

It looks like activeadmin has moved on to using the successor to meta_search, Ransack. (See this commit]). Looks like it's time for activeadmin-mongoid to do the same.

Filter on Index page not working

Hi

I'm not sure if this is a duplicate issue but the filter is not working ?

For example if i have a User.rb model with a name field and if i declare:

ActiveAdmin.register User do
...
filter :name, :as => :string
end

it throws the following error:

undefined method `name_contains' for #Array:0x007f91f16a60a0

Update rubygems to latest version, or update README installation instructions

I tried to bundle install with gem "activeadmin-mongoid", but it failed because the gem that's hosted on rubygems (version 0.0.1) does not work with Mongoid 3.1.4, which is what I'm using.

In order to use the latest code, I had to do this in my Gemfile:

gem 'activeadmin-mongoid', :git => "git://github.com/elia/activeadmin-mongoid.git"

Is there a reason why the gem hasn't been updated in Rubygems since last year?

undefined method `id' for true:TrueClass

Showing /usr/local/lib/ruby/gems/1.9.1/gems/activeadmin-0.5.0/app/views/active_admin/resource/index.html.arb where line #1 raised:

undefined method `id' for true:TrueClass
Extracted source (around line #1):

1: insert_tag renderer_for(:index)

Trace in this Gist

undefined method `inverse_of_field' for nil:NilClass

When trying to update a document, Rails shows the following exception:
undefined method 'inverse_of_field' for nil:NilClass

The full trace is:

mongoid (3.0.14) lib/mongoid/relations/referenced/one.rb:131:in `criteria'
mongoid (3.0.14) lib/mongoid/relations/metadata.rb:153:in `criteria'
mongoid (3.0.14) lib/mongoid/relations/builders/referenced/one.rb:20:in `build'
mongoid (3.0.14) lib/mongoid/relations/accessors.rb:43:in `create_relation'
mongoid (3.0.14) lib/mongoid/relations/accessors.rb:26:in `__build__'
mongoid (3.0.14) lib/mongoid/relations/accessors.rb:171:in `block (3 levels) in getter'
mongoid (3.0.14) lib/mongoid/threaded/lifecycle.rb:125:in `_loading'
mongoid (3.0.14) lib/mongoid/relations/accessors.rb:171:in `block (2 levels) in getter'
mongoid (3.0.14) lib/mongoid/threaded/lifecycle.rb:84:in `_building'
mongoid (3.0.14) lib/mongoid/relations/accessors.rb:170:in `block in getter'
mongoid (3.0.14) lib/mongoid/validations.rb:54:in `read_attribute_for_validation'
activemodel (3.2.11) lib/active_model/validator.rb:151:in `block in validate'
activemodel (3.2.11) lib/active_model/validator.rb:150:in `each'
activemodel (3.2.11) lib/active_model/validator.rb:150:in `validate'
activesupport (3.2.11) lib/active_support/callbacks.rb:310:in `_callback_before_3785'
activesupport (3.2.11) lib/active_support/callbacks.rb:407:in `_run__896993876__validate__501330736__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
mongoid (3.0.14) lib/mongoid/callbacks.rb:114:in `run_callbacks'
activemodel (3.2.11) lib/active_model/validations.rb:228:in `run_validations!'
activemodel (3.2.11) lib/active_model/validations/callbacks.rb:53:in `block in run_validations!'
activesupport (3.2.11) lib/active_support/callbacks.rb:403:in `_run__896993876__validation__501330736__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
mongoid (3.0.14) lib/mongoid/callbacks.rb:114:in `run_callbacks'
activemodel (3.2.11) lib/active_model/validations/callbacks.rb:53:in `run_validations!'
activemodel (3.2.11) lib/active_model/validations.rb:195:in `valid?'
mongoid (3.0.14) lib/mongoid/validations.rb:78:in `valid?'
activemodel (3.2.11) lib/active_model/validations.rb:203:in `invalid?'
mongoid (3.0.14) lib/mongoid/persistence/modification.rb:22:in `prepare'
mongoid (3.0.14) lib/mongoid/persistence/operations/update.rb:43:in `persist'
mongoid (3.0.14) lib/mongoid/persistence.rb:139:in `update'
mongoid (3.0.14) lib/mongoid/persistence.rb:81:in `save'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:28:in `block in save_resource'
activeadmin (0.5.1) lib/active_admin/callbacks.rb:78:in `run_save_callbacks'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:27:in `save_resource'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:47:in `block in update_resource'
activeadmin (0.5.1) lib/active_admin/callbacks.rb:78:in `run_update_callbacks'
activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:46:in `update_resource'
inherited_resources (1.3.1) lib/inherited_resources/actions.rb:45:in `update'
activeadmin (0.5.1) lib/active_admin/resource_controller/actions.rb:56:in `update'
actionpack (3.2.11) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (3.2.11) lib/active_support/callbacks.rb:458:in `_run__769687236__process_action__1037770905__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.11) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.11) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.11) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.11) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
newrelic_rpm (3.5.3.25) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
newrelic_rpm (3.5.3.25) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:in `block in perform_action_with_newrelic_trace'
newrelic_rpm (3.5.3.25) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
newrelic_rpm (3.5.3.25) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:in `perform_action_with_newrelic_trace'
newrelic_rpm (3.5.3.25) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
actionpack (3.2.11) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.11) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.11) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.11) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.11) lib/action_dispatch/routing/route_set.rb:601:in `call'
newrelic_rpm (3.5.3.25) lib/new_relic/rack/error_collector.rb:8:in `call'
newrelic_rpm (3.5.3.25) lib/new_relic/rack/browser_monitoring.rb:12:in `call'
newrelic_rpm (3.5.3.25) lib/new_relic/rack/developer_mode.rb:24:in `call'
mongoid (3.0.14) lib/rack/mongoid/middleware/identity_map.rb:34:in `block in call'
mongoid (3.0.14) lib/mongoid/unit_of_work.rb:39:in `unit_of_work'
mongoid (3.0.14) lib/rack/mongoid/middleware/identity_map.rb:34:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.3) lib/rack/etag.rb:23:in `call'
rack (1.4.3) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.3) lib/rack/session/abstract/id.rb:210:in `context'
rack (1.4.3) lib/rack/session/abstract/id.rb:205:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/cookies.rb:341:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `_run__512458398__call__501330736__callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.11) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.11) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.11) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.11) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.11) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.11) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.3) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.11) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.3) lib/rack/lock.rb:15:in `call'
actionpack (3.2.11) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.11) lib/rails/engine.rb:479:in `call'
railties (3.2.11) lib/rails/application.rb:223:in `call'
rack (1.4.3) lib/rack/content_length.rb:14:in `call'
railties (3.2.11) lib/rails/rack/log_tailer.rb:17:in `call'
thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
thin (1.3.1) lib/thin/connection.rb:78:in `catch'
thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
thin (1.3.1) lib/thin/connection.rb:53:in `process'
thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
thin (1.3.1) lib/thin/server.rb:159:in `start'
rack (1.4.3) lib/rack/handler/thin.rb:13:in `run'
rack (1.4.3) lib/rack/server.rb:268:in `start'
railties (3.2.11) lib/rails/commands/server.rb:70:in `start'
railties (3.2.11) lib/rails/commands.rb:55:in `block in <top (required)>'
railties (3.2.11) lib/rails/commands.rb:50:in `tap'
railties (3.2.11) lib/rails/commands.rb:50:in `<top (required)>'
script/rails:6:in `require'
script/rails:6:in `<main>'

Filter :as => :string throws "undefined method `to_sym' for nil:NilClass"

filter :name, :as => :string, :input_html => { :value => "" }

Error thrown in:

/activeadmin-mongoid-27ce04f84655/lib/meta_search/searches/mongoid.rb:19:in `block in build'

Parameters passed:

{"utf8"=>"โœ“",
 "q"=>{"name_contains"=>"Carambola"},
 "commit"=>"Filter",
 "order"=>"[:_id]_desc"}

Any help would be appreciated!

I tried forking and using ActiveAdmin 6.1, but no luck.

undefined method `metasearch' for AdminUser:Class

Hello,

I just created a new Rails application, configured my Gemfile accordingly and followed the install instructions from the README.md file.

The Admin dashboard works just fine, but when I attempt to add a new page for Admin Users, I get "NoMethodError in Admin::AdminUsersController#index".

I was curious if maybe I overlooked something or if anyone has seen this error before and has a fix for it?

Thanks in advance!

undefined method `object' for #<Mongoid::Criteria:0x..>

Hi I get this when I try to go to any resource/index

ActionView::Template::Error (undefined method `object' for #<Mongoid::Criteria:0x007f948a8bcf10>):
    1: insert_tag renderer_for(:index)
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/mongoid-38de2e96edc8/lib/mongoid/criteria.rb:501:in `method_missing'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/formtastic_addons.rb:40:in `klass'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/formtastic_addons.rb:20:in `reflection_for'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/forms.rb:26:in `default_input_type'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/forms.rb:15:in `filter'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/forms.rb:72:in `block (2 levels) in active_admin_filters_form_for'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/forms.rb:66:in `each'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/forms.rb:66:in `block in active_admin_filters_form_for'
  actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:38:in `block in capture'
  actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:200:in `with_output_buffer'
  actionpack (4.0.0) lib/action_view/helpers/capture_helper.rb:38:in `capture'
  actionpack (4.0.0) lib/action_view/helpers/form_helper.rb:435:in `form_for'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/forms.rb:65:in `active_admin_filters_form_for'
  arbre (1.0.1) lib/arbre/element.rb:175:in `method_missing'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/filters/resource_extension.rb:122:in `block in filters_sidebar_section'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/components/sidebar_section.rb:19:in `instance_eval'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/components/sidebar_section.rb:19:in `build_sidebar_content'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/components/sidebar_section.rb:12:in `build'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
  arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `sidebar_section'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:122:in `block (2 levels) in build_sidebar'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:121:in `collect'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:121:in `block in build_sidebar'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
  arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:120:in `build_sidebar'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:66:in `block in build_page_content'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
  arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:64:in `build_page_content'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:47:in `block (2 levels) in build_page'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:31:in `block in build_tag'
  arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:14:in `div'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:44:in `block in build_page'
  arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:49:in `with_current_arbre_element'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:43:in `build_page'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/views/pages/base.rb:10:in `build'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:30:in `block in build_tag'
  arbre (1.0.1) lib/arbre/context.rb:92:in `with_current_arbre_element'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:26:in `build_tag'
  arbre (1.0.1) lib/arbre/element/builder_methods.rb:39:in `insert_tag'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/app/views/active_admin/resource/index.html.arb:1:in `block in ___sers_goyox____rbenv_versions_______p____lib_ruby_gems_______bundler_gems_active_admin_ac____ef__cf_app_views_active_admin_resource_index_html_arb___2443507677352339677_70137946052220'
  arbre (1.0.1) lib/arbre/context.rb:45:in `instance_eval'
  arbre (1.0.1) lib/arbre/context.rb:45:in `initialize'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/app/views/active_admin/resource/index.html.arb:1:in `new'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/app/views/active_admin/resource/index.html.arb:1:in `___sers_goyox____rbenv_versions_______p____lib_ruby_gems_______bundler_gems_active_admin_ac____ef__cf_app_views_active_admin_resource_index_html_arb___2443507677352339677_70137946052220'
  actionpack (4.0.0) lib/action_view/template.rb:143:in `block in render'
  activesupport (4.0.0) lib/active_support/notifications.rb:161:in `instrument'
  actionpack (4.0.0) lib/action_view/template.rb:141:in `render'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:49:in `block (2 levels) in render_template'
  actionpack (4.0.0) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.0) lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:48:in `block in render_template'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:56:in `render_with_layout'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:47:in `render_template'
  actionpack (4.0.0) lib/action_view/renderer/template_renderer.rb:17:in `render'
  actionpack (4.0.0) lib/action_view/renderer/renderer.rb:42:in `render_template'
  actionpack (4.0.0) lib/action_view/renderer/renderer.rb:23:in `render'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:127:in `_render_template'
  actionpack (4.0.0) lib/action_controller/metal/streaming.rb:219:in `_render_template'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:120:in `render_to_body'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:33:in `render_to_body'
  actionpack (4.0.0) lib/action_controller/metal/renderers.rb:26:in `render_to_body'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:97:in `render'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:16:in `render'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:41:in `block (2 levels) in render'
  activesupport (4.0.0) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:296:in `realtime'
  activesupport (4.0.0) lib/active_support/core_ext/benchmark.rb:12:in `ms'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:41:in `block in render'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:84:in `cleanup_view_runtime'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:40:in `render'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/resource_controller/actions.rb:13:in `block (2 levels) in index'
  actionpack (4.0.0) lib/action_controller/metal/responder.rb:231:in `call'
  actionpack (4.0.0) lib/action_controller/metal/responder.rb:231:in `default_render'
  actionpack (4.0.0) lib/action_controller/metal/responder.rb:161:in `to_html'
  responders (1.0.0.rc) lib/responders/flash_responder.rb:104:in `to_html'
  actionpack (4.0.0) lib/action_controller/metal/responder.rb:154:in `respond'
  actionpack (4.0.0) lib/action_controller/metal/responder.rb:147:in `call'
  actionpack (4.0.0) lib/action_controller/metal/mime_responds.rb:330:in `respond_with'
  inherited_resources (1.4.1) lib/inherited_resources/actions.rb:7:in `index'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/active_admin-ac4918ef99cf/lib/active_admin/resource_controller/actions.rb:11:in `index'
  actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.0.0) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (4.0.0) lib/active_support/callbacks.rb:413:in `_run__4544908531130560647__process_action__callbacks'
  activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
  actionpack (4.0.0) lib/abstract_controller/base.rb:136:in `process'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:in `process'
  actionpack (4.0.0) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.0.0) lib/action_controller/metal.rb:231:in `block in action'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/mongoid-38de2e96edc8/lib/rack/mongoid/middleware/identity_map.rb:34:in `block in call'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/mongoid-38de2e96edc8/lib/mongoid/unit_of_work.rb:39:in `unit_of_work'
  /Users/goyox86/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/mongoid-38de2e96edc8/lib/rack/mongoid/middleware/identity_map.rb:34:in `call'
  rack-cors (0.2.8) lib/rack/cors.rb:54:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__4556293363330684592__call__callbacks'
  activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/reloader.rb:64:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  rack (1.5.2) lib/rack/lock.rb:17:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
  railties (4.0.0) lib/rails/engine.rb:511:in `call'
  railties (4.0.0) lib/rails/application.rb:97:in `call'
  rack (1.5.2) lib/rack/content_length.rb:14:in `call'
  thin (1.5.1) lib/thin/connection.rb:81:in `block in pre_process'
  thin (1.5.1) lib/thin/connection.rb:79:in `catch'
  thin (1.5.1) lib/thin/connection.rb:79:in `pre_process'
  thin (1.5.1) lib/thin/connection.rb:54:in `process'
  thin (1.5.1) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.3) lib/eventmachine.rb:187:in `run'
  thin (1.5.1) lib/thin/backends/base.rb:63:in `start'
  thin (1.5.1) lib/thin/server.rb:159:in `start'
  rack (1.5.2) lib/rack/handler/thin.rb:16:in `run'
  rack (1.5.2) lib/rack/server.rb:264:in `start'
  railties (4.0.0) lib/rails/commands/server.rb:84:in `start'
  railties (4.0.0) lib/rails/commands.rb:78:in `block in <top (required)>'
  railties (4.0.0) lib/rails/commands.rb:73:in `tap'
  railties (4.0.0) lib/rails/commands.rb:73:in `<top (required)>'
  bin/rails:4:in `require'
  bin/rails:4:in `<main>'

My gemfile looks like this

source 'https://rubygems.org'

ruby '2.0.0'

gem 'active_model_serializers'
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4'
gem 'activeadmin-mongoid', github: 'DanielePalombo/activeadmin-mongoid'
gem 'aws-sdk', '~> 1.3.4'
gem 'devise', github: 'plataformatec/devise'
gem 'doorkeeper'
gem 'foreman'
gem 'formtastic', github: 'justinfrench/formtastic'
gem 'mongoid', github: 'mongoid'
gem 'mongoid-tree', require: 'mongoid/tree'
gem 'mongoid-paperclip', require: 'mongoid_paperclip'
gem 'pry-rails'
gem 'puma'
gem 'rack-cors', require: 'rack/cors'
gem 'rails', '4.0.0'
gem 'state_machine'

I've been trying to track down the bug without success, does anyone have experienced something similar?

Filter with mutliple fields doesn't work

ActiveAdmin.register User do
    filter :email_or_alternate_email, :as => :string
end

This doesn't return any results with mongoid (works with mysql)

The following are my Gem versions:

activeadmin-mongoid (0.1.0)
activeadmin (~> 0.5)
meta_search (>= 1.1.0.pre)
mongoid (>= 2.4)

Bug with numeration of pages in pagination

Paginator on index page shows incorrect numeration.

This bug comes from Mongoid#Criteria's count.

User.criteria.limit(1).count returns number of all users.
To make it return 1, we should pass argument true to method count.
User.criteria.limit(1).count(true) returns 1

My experience setting up activeadmin-mongoid for rails 4

Just to share this with you guys the steps I take to resolve errors I have encountered when setting up activeadmin-mongoid for rails 4.1.1

You need those gems in Gemfile:

gem 'devise'
gem 'activeadmin', github: 'gregbell/active_admin'
gem 'activeadmin-mongoid', github: 'elia/activeadmin-mongoid', branch: 'rails4'

  • somehow devise is not included as part of activeadmin dependency, so have to add it manually

This issue #76 can be solved by following @djsmentya's answer at heartcombo/devise#2949

Follow this SO answer to avoid activeadmin.css taking over app's css
http://stackoverflow.com/a/11745446/1742820

Follow @funfun's answer in the link below to fix the "undefined method `object' for #Mongoid::Criteria:0x.." I guess from formtastic
#52

Hopefully this issue would help out wandering google searching souls trying to make activeadmin-mongoid work on rails4

I would appreciate if the support for rails4 can benefit from this report. Because this is definitely not straightforward...

using nested field values

my document:

    {
       "_id": ObjectId("519733333fb6664b5d000000"),
       "email": "[email protected]",
       "dates": {
           "pre_register": "2013-05-18 04:53:38" 
       } 
    }

my model:

    class Member
        include Mongoid::Document
        store_in collection:'member'
        field :email
        field :dates
    end

how to use the field dates.pre_register? I tried this: field:dates.pre_register
but no success

what about Hash and Array fields?

Can we remove dependency on 'activeadmin', '~> 0.6.1'?

It seems activeadmin has been updated to 1.0.0.pre which breaks dependency
gem.add_runtime_dependency 'activeadmin', '~> 0.6.1'

I am trying to deploy on heroku

Bundler could not find compatible versions for gem "activeadmin":
In Gemfile:
activeadmin-mongoid (>= 0) ruby depends on
activeadmin (~> 0.6.1) ruby

activeadmin (1.0.0.pre)

Filters not working with ActiveAdmin 0.6

Using filters results in:

undefined method `yyyy_contains' for #<Array:0x007fbd7990ed20>

mongoid (3.1.3) lib/mongoid/criteria.rb:510:in `method_missing'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:1159:in `value_before_type_cast'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:1147:in `value_before_type_cast'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:1041:in `block in to_input_field_tag'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:1041:in `fetch'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:1041:in `to_input_field_tag'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:690:in `text_field'
actionpack (3.2.13) lib/action_view/helpers/form_helper.rb:1284:in `text_field'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/inputs/filter_string_input.rb:9:in `block in to_html'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
haml (4.0.2) lib/haml/helpers/action_view_xss_mods.rb:5:in `with_output_buffer_with_haml_xss'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:40:in `capture'
haml (4.0.2) lib/haml/helpers/action_view_mods.rb:59:in `capture_with_haml'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/inputs/filter_base.rb:8:in `input_wrapping'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/inputs/filter_string_input.rb:7:in `to_html'
formtastic (2.2.1) lib/formtastic/helpers/input_helper.rb:240:in `input'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/form_builder.rb:19:in `block in input'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/form_builder.rb:177:in `with_new_form_buffer'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/form_builder.rb:19:in `input'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/filters/forms.rb:11:in `filter'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/filters/forms.rb:80:in `block (2 levels) in active_admin_filters_form_for'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/filters/forms.rb:75:in `each'
/Users/markwhi/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/bundler/gems/active_admin-46b5bf8d7ef9/lib/active_admin/filters/forms.rb:75:in `block in active_admin_filters_form_for'
actionpack (3.2.13) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.