Closed gjappleton closed 5 years ago
Note: https://github.com/thoughtbot/administrate/issues/182 doesn't have the info i'm looking for as I've already created the files it suggests. One hint I think is looking into the dashboard manifest, but at this juncture I am still figuring out what it does//how to even access it.
Started POST "/__better_errors/2445b3021c0baf92/variables" for ::1 at 2017-02-23 13:18:35 -0500 Started GET "/admin/tags" for ::1 at 2017-02-23 13:19:11 -0500 Processing by Admin::TagsController#index as HTML Rendering /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/administrate-0.3.0/app/views/administrate/application/index.html.erb within layouts/administrate/application Rendered /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/administrate-0.3.0/app/views/administrate/application/_search.html.erb (3.8ms) Tag Load (0.4ms) SELECT "tags". FROM "tags" LIMIT $1 OFFSET $2 [["LIMIT", 20], ["OFFSET", 0]] Category Load (0.5ms) SELECT "categories". FROM "categories" WHERE "categories"."id" = $1 ORDER BY categories.created_at DESC LIMIT $2 [["id", 2], ["LIMIT", 1]] (0.7ms) SELECT COUNT(*) FROM "taggings" WHERE "taggings"."tag_id" = $1 [["tag_id", 1]] Rendered /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/administrate-0.3.0/app/views/fields/has_many/_index.html.erb (2.7ms) Rendered /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/administrate-0.3.0/app/views/fields/has_many/_index.html.erb (7.1ms) Rendered /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/administrate-0.3.0/app/views/administrate/application/_collection.html.erb (35.4ms) Rendered /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/administrate-0.3.0/app/views/administrate/application/index.html.erb within layouts/administrate/application (76.6ms) Completed 500 Internal Server Error in 122ms (ActiveRecord: 1.6ms)
DEPRECATION WARNING: #original_exception is deprecated. Use #cause instead. (called from initialize at /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/better_errors-2.1.1/lib/better_errors/raised_exception.rb:7) DEPRECATION WARNING: #original_exception is deprecated. Use #cause instead. (called from initialize at /Users/gabrielappleton/.rvm/gems/ruby-2.3.3/gems/better_errors-2.1.1/lib/better_errors/raised_exception.rb:8)
NoMethodError - undefined method size' for nil:NilClass: administrate (0.3.0) app/views/fields/has_many/_index.html.erb:19:in
_sers_gabrielappletonrvm_gems_ruby_gems_administrate___app_views_fields_has_many__index_htmlerb727911858109318415_70337803785420'
actionview (5.0.0.1) lib/action_view/template.rb:158:in block in render' activesupport (5.0.0.1) lib/active_support/notifications.rb:166:in
instrument'
actionview (5.0.0.1) lib/action_view/template.rb:348:in instrument' actionview (5.0.0.1) lib/action_view/template.rb:156:in
render'
actionview (5.0.0.1) lib/action_view/renderer/partial_renderer.rb:343:in render_partial' actionview (5.0.0.1) lib/action_view/renderer/partial_renderer.rb:311:in
block in render'
actionview (5.0.0.1) lib/action_view/renderer/abstract_renderer.rb:42:in block in instrument' activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in
block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in
instrument'
actionview (5.0.0.1) lib/action_view/renderer/abstract_renderer.rb:41:in instrument' actionview (5.0.0.1) lib/action_view/renderer/partial_renderer.rb:310:in
render'
actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:47:in render_partial' actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:21:in
render'
actionview (5.0.0.1) lib/action_view/helpers/rendering_helper.rb:32:in render' administrate (0.3.0) app/helpers/administrate/application_helper.rb:5:in
render_field'
administrate (0.3.0) app/views/administrate/application/_collection.html.erb:63:in block (2 levels) in ___sers_gabrielappleton__rvm_gems_ruby_______gems_administrate_______app_views_administrate_application__collection_html_erb___3867413717467151431_70337791459520' administrate (0.3.0) app/views/administrate/application/_collection.html.erb:61:in
block in _sers_gabrielappletonrvm_gems_ruby_gems_administrate___app_views_administrate_applicationcollection_html_erb_3867413717467151431_70337791459520'
activerecord (5.0.0.1) lib/active_record/relation/delegation.rb:38:in each' administrate (0.3.0) app/views/administrate/application/_collection.html.erb:55:in
___sers_gabrielappletonrvm_gems_ruby_gems_administrate___app_views_administrate_applicationcollection_html_erb_3867413717467151431_70337791459520'
actionview (5.0.0.1) lib/action_view/template.rb:158:in block in render' activesupport (5.0.0.1) lib/active_support/notifications.rb:166:in
instrument'
actionview (5.0.0.1) lib/action_view/template.rb:348:in instrument' actionview (5.0.0.1) lib/action_view/template.rb:156:in
render'
actionview (5.0.0.1) lib/action_view/renderer/partial_renderer.rb:343:in render_partial' actionview (5.0.0.1) lib/action_view/renderer/partial_renderer.rb:311:in
block in render'
actionview (5.0.0.1) lib/action_view/renderer/abstract_renderer.rb:42:in block in instrument' activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in
block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in
instrument'
actionview (5.0.0.1) lib/action_view/renderer/abstract_renderer.rb:41:in instrument' actionview (5.0.0.1) lib/action_view/renderer/partial_renderer.rb:310:in
render'
actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:47:in render_partial' actionview (5.0.0.1) lib/action_view/helpers/rendering_helper.rb:35:in
render'
administrate (0.3.0) app/views/administrate/application/index.html.erb:43:in `___sers_gabrielappletonrvm_gems_ruby_gems_administrate___app_views_administrate_application_index_htmlerb3764132621317459412_70337790746060'
actionview (5.0.0.1) lib/action_view/template.rb:158:in block in render' activesupport (5.0.0.1) lib/active_support/notifications.rb:166:in
instrument'
actionview (5.0.0.1) lib/action_view/template.rb:348:in instrument' actionview (5.0.0.1) lib/action_view/template.rb:156:in
render'
actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:54:in block (2 levels) in render_template' actionview (5.0.0.1) lib/action_view/renderer/abstract_renderer.rb:42:in
block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in block in instrument' activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in
instrument'
activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in instrument' actionview (5.0.0.1) lib/action_view/renderer/abstract_renderer.rb:41:in
instrument'
actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:53:in block in render_template' actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:61:in
render_with_layout'
actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:52:in render_template' actionview (5.0.0.1) lib/action_view/renderer/template_renderer.rb:14:in
render'
actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:42:in render_template' actionview (5.0.0.1) lib/action_view/renderer/renderer.rb:23:in
render'
actionview (5.0.0.1) lib/action_view/rendering.rb:103:in _render_template' actionpack (5.0.0.1) lib/action_controller/metal/streaming.rb:217:in
_render_template'
actionview (5.0.0.1) lib/action_view/rendering.rb:83:in render_to_body' actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:52:in
render_to_body'
actionpack (5.0.0.1) lib/action_controller/metal/renderers.rb:144:in render_to_body' actionpack (5.0.0.1) lib/abstract_controller/rendering.rb:26:in
render'
actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:36:in render' actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:44:in
block (2 levels) in render'
activesupport (5.0.0.1) lib/active_support/core_ext/benchmark.rb:12:in block in ms' /Users/gabrielappleton/.rvm/rubies/ruby-2.3.3/lib/ruby/2.3.0/benchmark.rb:308:in
realtime'
activesupport (5.0.0.1) lib/active_support/core_ext/benchmark.rb:12:in ms' actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:44:in
block in render'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:87:in cleanup_view_runtime' activerecord (5.0.0.1) lib/active_record/railties/controller_runtime.rb:25:in
cleanup_view_runtime'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:43:in render' administrate (0.3.0) app/controllers/administrate/application_controller.rb:12:in
index'
actionpack (5.0.0.1) lib/action_controller/metal/basic_implicit_render.rb:4:in send_action' actionpack (5.0.0.1) lib/abstract_controller/base.rb:188:in
process_action'
actionpack (5.0.0.1) lib/action_controller/metal/rendering.rb:30:in process_action' actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:20:in
block in process_action'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:126:in call' activesupport (5.0.0.1) lib/active_support/callbacks.rb:506:in
block (2 levels) in compile'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:455:in call' activesupport (5.0.0.1) lib/active_support/callbacks.rb:101:in
run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in _run_process_action_callbacks' activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in
run_callbacks'
actionpack (5.0.0.1) lib/abstract_controller/callbacks.rb:19:in process_action' actionpack (5.0.0.1) lib/action_controller/metal/rescue.rb:20:in
process_action'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:32:in block in process_action' activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in
block in instrument'
activesupport (5.0.0.1) lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (5.0.0.1) lib/active_support/notifications.rb:164:in
instrument'
actionpack (5.0.0.1) lib/action_controller/metal/instrumentation.rb:30:in process_action' actionpack (5.0.0.1) lib/action_controller/metal/params_wrapper.rb:248:in
process_action'
activerecord (5.0.0.1) lib/active_record/railties/controller_runtime.rb:18:in process_action' actionpack (5.0.0.1) lib/abstract_controller/base.rb:126:in
process'
actionview (5.0.0.1) lib/action_view/rendering.rb:30:in process' actionpack (5.0.0.1) lib/action_controller/metal.rb:190:in
dispatch'
actionpack (5.0.0.1) lib/action_controller/metal.rb:262:in dispatch' actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:50:in
dispatch'
actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:32:in serve' actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:39:in
block in serve'
actionpack (5.0.0.1) lib/action_dispatch/journey/router.rb:26:in serve' actionpack (5.0.0.1) lib/action_dispatch/routing/route_set.rb:725:in
call'
warden (1.2.6) lib/warden/manager.rb:35:in block in call' warden (1.2.6) lib/warden/manager.rb:34:in
call'
rack (2.0.1) lib/rack/etag.rb:25:in call' rack (2.0.1) lib/rack/conditional_get.rb:25:in
call'
rack (2.0.1) lib/rack/head.rb:12:in call' rack (2.0.1) lib/rack/session/abstract/id.rb:222:in
context'
rack (2.0.1) lib/rack/session/abstract/id.rb:216:in call' actionpack (5.0.0.1) lib/action_dispatch/middleware/cookies.rb:613:in
call'
activerecord (5.0.0.1) lib/active_record/migration.rb:552:in call' actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:38:in
block in call'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:97:in `run_callbacks__'
activesupport (5.0.0.1) lib/active_support/callbacks.rb:750:in _run_call_callbacks' activesupport (5.0.0.1) lib/active_support/callbacks.rb:90:in
run_callbacks'
actionpack (5.0.0.1) lib/action_dispatch/middleware/callbacks.rb:36:in call' actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in
call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/remote_ip.rb:79:in call' better_errors (2.1.1) lib/better_errors/middleware.rb:84:in
protected_app_call'
better_errors (2.1.1) lib/better_errors/middleware.rb:79:in better_errors_call' better_errors (2.1.1) lib/better_errors/middleware.rb:57:in
call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in call' web-console (3.4.0) lib/web_console/middleware.rb:135:in
call_app'
web-console (3.4.0) lib/web_console/middleware.rb:28:in block in call' web-console (3.4.0) lib/web_console/middleware.rb:18:in
call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/show_exceptions.rb:31:in call' railties (5.0.0.1) lib/rails/rack/logger.rb:36:in
call_app'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in block in call' activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in
block in tagged'
activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:26:in tagged' activesupport (5.0.0.1) lib/active_support/tagged_logging.rb:70:in
tagged'
railties (5.0.0.1) lib/rails/rack/logger.rb:24:in call' sprockets-rails (3.2.0) lib/sprockets/rails/quiet_assets.rb:13:in
call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/request_id.rb:24:in call' rack (2.0.1) lib/rack/method_override.rb:22:in
call'
rack (2.0.1) lib/rack/runtime.rb:22:in call' activesupport (5.0.0.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in
call'
actionpack (5.0.0.1) lib/action_dispatch/middleware/executor.rb:12:in call' actionpack (5.0.0.1) lib/action_dispatch/middleware/static.rb:136:in
call'
rack (2.0.1) lib/rack/sendfile.rb:111:in call' railties (5.0.0.1) lib/rails/engine.rb:522:in
call'
puma (3.6.2) lib/puma/configuration.rb:225:in call' puma (3.6.2) lib/puma/server.rb:578:in
handle_request'
puma (3.6.2) lib/puma/server.rb:415:in process_client' puma (3.6.2) lib/puma/server.rb:275:in
block in run'
puma (3.6.2) lib/puma/thread_pool.rb:116:in `block in spawn_thread'
Started POST "/__better_errors/f43b5c3706bbe7bf/variables" for ::1 at 2017-02-23 13:19:11 -0500
anyone??? :-(
Hey @gjappleton! Sorry to the delayed response.
I know you already said #182 does not have what you are looking for because you already have those files. But did you try removing the files you created and letting the generator generate them for you? There may be a difference between how you created the files and how the generator creates them.
If that doesn't work, it might be helpful to link a gist that has all the relevant files you created so that maybe someone can spot the problem.
hi @carlosramireziii ! yes, i did let the generator generate them. what i did was:
and that gets me to hitting the error I posted. I can look into posting a gist with all the relevant files if nothing else comes to mind at the moment for you .
thanks for the response!
A gist would be great!
@carlosramireziii here's a gist with the controller, dashboard from adminstrate as well as the routes file. Should i add anything else?
https://gist.github.com/gjappleton/ec98c83f6ff5c946d12c289c27bf9bda
...umm, I'm assuming you did not REALLY do:
rails generate administrate:dashboard Foo
but really did:
rails generate administrate:dashboard Tag
Best to explain exactly what you really did, not use generic example as at times people are actually using a generic example by mistake. Also, if you would do:
rails generate administrate:dashboard Tag > generated_output.txt
you would create useful information of what files are being generated in the file
generated_output.txt
which would be useful in a gist.
This line is jumping out at me as something to look into
influencers: Field::HasMany.with_options(class_name: "Influencers")
What was your intention with using the class_name
option? Is the class name definitely Influencers
? If you temporary remove that field from your dashboard (remove occurrences of :influencers
from the dashboard), does it work?
I would take a look at that and report back.
@gjappleton Just seeing if there were any updates on this. Let us know! Thanks
For any that find this, if you already have an existing Administrate dashboard:
New models will not show up in the side list until you add them to the routes; for details look wherever your gems are installled, as it references:
gems/administrate-0.10.0/app/views/administrate/application/_navigation.html.erb
Thanks @dfwmountainbiker !
For future reference, this is also available in the getting started docs. Closing it 👍
Hello! Hoping someone can help me out.
What are the steps to adding a new model to the administrate framework?
I'm hitting a: NoMethodError at /admin/tags undefined method `size' for nil:NilClass error as a result of not adding my 'tags' model properly. I've added a tags_controller under admin, a tag resource under admin route in routes.rb, and a tag_dashboard.rb in dashboard folder.
Thank you!