简体   繁体   中英

activeadmin: keeps loading page

I ve got model Comment trying to administer this model with activeadmin:

rails g active_admin:resource Comment

Active admin created file: app\\admin\\comments.rb with:

ActiveAdmin.register Comment, :as => 'AllComments' do
  menu :parent => "Campaigns", :priority => 55

end

From rake:routes :

admin_all_comments GET    /admin/all_comments(.:format)                                                      admin/all_comments#index
                                           POST   /admin/all_comments(.:format)                                                      admin/all_comments#create
                     new_admin_all_comment GET    /admin/all_comments/new(.:format)                                                  admin/all_comments#new
                    edit_admin_all_comment GET    /admin/all_comments/:id/edit(.:format)                                             admin/all_comments#edit
                         admin_all_comment GET    /admin/all_comments/:id(.:format)                                                  admin/all_comments#show
                                           PUT    /admin/all_comments/:id(.:format)                                                  admin/all_comments#update
                                           DELETE /admin/all_comments/:id(.:format)                                                  admin/all_comments#destroy
                            admin_comments GET    /admin/comments(.:format)                                                                      admin/comments#index

Issue: while accessing admin\\all_comments I got that comments are loading for ages.

Note:

  1. There are only 24 records in the comment model
  2. Comment model is a polymorphic association as described by Ryan Bates (http://railscasts.com/episodes/154-polymorphic-association)
  3. I am using kaminari settings { paginates_per 10 } on comment model, however that should not affect activeadmin at all, from my perspective, of course
  4. There is no output from the console, and it def there is no error, so that's why it keeps loading the page

Any help regarding this question would be appreciated

My Stack: ruby-1.9.3-p125 , rails-3.2.8 , WEBrick 1.3.1 , mac os lion

好的,这是解决方案,我添加了filter: commentable Comments.rb filter: commentable ,并且工作正常

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM