Skip to content

Instantly share code, notes, and snippets.

@mrjonesbot
Created July 9, 2024 19:23
Show Gist options
  • Save mrjonesbot/ce4c9923ddaabba7b5cfbff391417f8f to your computer and use it in GitHub Desktop.
Save mrjonesbot/ce4c9923ddaabba7b5cfbff391417f8f to your computer and use it in GitHub Desktop.
NoMethodError in Admin::Users#new
Showing /Users/nathanjones/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/administrate-field-nested_has_many-2.1.0/app/views/fields/nested_has_many/_fields.html.erb where line #8 raised:
undefined method `new_record?' for nil:NilClass
is_dynamic = f.object.new_record?
^^^^^^^^^^^^
Extracted source (around line #29):
27
28
29
30
31
32
html_options ||= {}
is_dynamic = f.object.new_record?
classes = []
classes << "remove_fields"
Tip: You may want to add gem 'error_highlight', '>= 0.4.0' into your Gemfile, which will display the fine-grained error location.
Trace of template inclusion: #<ActionView::Template /Users/nathanjones/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/administrate-field-nested_has_many-2.1.0/app/views/fields/nested_has_many/_form.html.erb locals=["f", "field"]>, #<ActionView::Template /Users/nathanjones/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/administrate-0.20.1/app/views/administrate/application/_form.html.erb locals=["page"]>, #<ActionView::Template /Users/nathanjones/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/administrate-0.20.1/app/views/administrate/application/new.html.erb locals=["page"]>
Rails.root: /Users/nathanjones/risekit/api
Application Trace | Framework Trace | Full Trace
cocoon (1.2.15) lib/cocoon/view_helpers.rb:29:in `link_to_remove_association'
administrate-field-nested_has_many (2.1.0) app/views/fields/nested_has_many/_fields.html.erb:8
actionview (7.1.3.4) lib/action_view/base.rb:264:in `public_send'
actionview (7.1.3.4) lib/action_view/base.rb:264:in `_run'
actionview (7.1.3.4) lib/action_view/template.rb:261:in `block in render'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/template.rb:549:in `instrument_render_template'
actionview (7.1.3.4) lib/action_view/template.rb:249:in `render'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:252:in `block in render_partial_template'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:237:in `render'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:83:in `render_partial_to_object'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:24:in `render'
actionview (7.1.3.4) lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
actionview (7.1.3.4) lib/action_view/base.rb:291:in `in_rendering_context'
actionview (7.1.3.4) lib/action_view/helpers/rendering_helper.rb:33:in `render'
administrate-field-nested_has_many (2.1.0) app/views/fields/nested_has_many/_form.html.erb:4
actionview (7.1.3.4) lib/action_view/helpers/capture_helper.rb:50:in `block in capture'
actionview (7.1.3.4) lib/action_view/buffers.rb:75:in `capture'
actionview (7.1.3.4) lib/action_view/helpers/capture_helper.rb:50:in `capture'
actionview (7.1.3.4) lib/action_view/helpers/form_helper.rb:1086:in `fields'
actionview (7.1.3.4) lib/action_view/helpers/form_helper.rb:1029:in `fields_for'
actionview (7.1.3.4) lib/action_view/helpers/form_helper.rb:2318:in `fields_for'
administrate-field-nested_has_many (2.1.0) app/views/fields/nested_has_many/_form.html.erb:3
actionview (7.1.3.4) lib/action_view/base.rb:264:in `public_send'
actionview (7.1.3.4) lib/action_view/base.rb:264:in `_run'
actionview (7.1.3.4) lib/action_view/template.rb:261:in `block in render'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/template.rb:549:in `instrument_render_template'
actionview (7.1.3.4) lib/action_view/template.rb:249:in `render'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:252:in `block in render_partial_template'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:237:in `render'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:83:in `render_partial_to_object'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:29:in `render_to_object'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:24:in `render'
actionview (7.1.3.4) lib/action_view/helpers/rendering_helper.rb:37:in `block in render'
actionview (7.1.3.4) lib/action_view/base.rb:291:in `in_rendering_context'
actionview (7.1.3.4) lib/action_view/helpers/rendering_helper.rb:33:in `render'
administrate (0.20.1) app/helpers/administrate/application_helper.rb:12:in `render_field'
administrate (0.20.1) app/views/administrate/application/_form.html.erb:44
administrate (0.20.1) app/views/administrate/application/_form.html.erb:42:in `each'
administrate (0.20.1) app/views/administrate/application/_form.html.erb:42
administrate (0.20.1) app/views/administrate/application/_form.html.erb:36:in `each'
administrate (0.20.1) app/views/administrate/application/_form.html.erb:36
actionview (7.1.3.4) lib/action_view/helpers/capture_helper.rb:50:in `block in capture'
actionview (7.1.3.4) lib/action_view/buffers.rb:75:in `capture'
actionview (7.1.3.4) lib/action_view/helpers/capture_helper.rb:50:in `capture'
actionview (7.1.3.4) lib/action_view/helpers/form_helper.rb:773:in `form_with'
actionview (7.1.3.4) lib/action_view/helpers/form_helper.rb:461:in `form_for'
administrate (0.20.1) app/views/administrate/application/_form.html.erb:17
actionview (7.1.3.4) lib/action_view/base.rb:264:in `public_send'
actionview (7.1.3.4) lib/action_view/base.rb:264:in `_run'
actionview (7.1.3.4) lib/action_view/template.rb:261:in `block in render'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/template.rb:549:in `instrument_render_template'
actionview (7.1.3.4) lib/action_view/template.rb:249:in `render'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:252:in `block in render_partial_template'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
actionview (7.1.3.4) lib/action_view/renderer/partial_renderer.rb:237:in `render'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:83:in `render_partial_to_object'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:55:in `render_partial'
actionview (7.1.3.4) lib/action_view/helpers/rendering_helper.rb:44:in `render'
administrate (0.20.1) app/views/administrate/application/new.html.erb:36
actionview (7.1.3.4) lib/action_view/base.rb:264:in `public_send'
actionview (7.1.3.4) lib/action_view/base.rb:264:in `_run'
actionview (7.1.3.4) lib/action_view/template.rb:261:in `block in render'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/template.rb:549:in `instrument_render_template'
actionview (7.1.3.4) lib/action_view/template.rb:249:in `render'
actionview (7.1.3.4) lib/action_view/renderer/template_renderer.rb:66:in `block (2 levels) in render_template'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/renderer/template_renderer.rb:60:in `block in render_template'
actionview (7.1.3.4) lib/action_view/renderer/template_renderer.rb:76:in `block in render_with_layout'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionview (7.1.3.4) lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'
actionview (7.1.3.4) lib/action_view/renderer/template_renderer.rb:59:in `render_template'
actionview (7.1.3.4) lib/action_view/renderer/template_renderer.rb:11:in `render'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:63:in `render_template_to_object'
actionview (7.1.3.4) lib/action_view/renderer/renderer.rb:31:in `render_to_object'
actionview (7.1.3.4) lib/action_view/rendering.rb:135:in `block in _render_template'
actionview (7.1.3.4) lib/action_view/base.rb:291:in `in_rendering_context'
actionview (7.1.3.4) lib/action_view/rendering.rb:134:in `_render_template'
actionpack (7.1.3.4) lib/action_controller/metal/streaming.rb:256:in `_render_template'
actionview (7.1.3.4) lib/action_view/rendering.rb:121:in `render_to_body'
actionpack (7.1.3.4) lib/action_controller/metal/rendering.rb:158:in `render_to_body'
actionpack (7.1.3.4) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
actionpack (7.1.3.4) lib/abstract_controller/rendering.rb:27:in `render'
actionpack (7.1.3.4) lib/action_controller/metal/rendering.rb:139:in `render'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:29:in `block (2 levels) in render'
/Users/nathanjones/.asdf/installs/ruby/3.1.3/lib/ruby/3.1.0/benchmark.rb:311:in `realtime'
activesupport (7.1.3.4) lib/active_support/core_ext/benchmark.rb:14:in `ms'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:29:in `block in render'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:98:in `cleanup_view_runtime'
activerecord (7.1.3.4) lib/active_record/railties/controller_runtime.rb:39:in `cleanup_view_runtime'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:28:in `render'
administrate (0.20.1) app/controllers/administrate/application_controller.rb:31:in `new'
actionpack (7.1.3.4) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (7.1.3.4) lib/abstract_controller/base.rb:224:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/rendering.rb:165:in `process_action'
actionpack (7.1.3.4) lib/abstract_controller/callbacks.rb:259:in `block in process_action'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:121:in `block in run_callbacks'
turbo-rails (2.0.5) lib/turbo-rails.rb:24:in `with_request_id'
turbo-rails (2.0.5) app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
ahoy_matey (4.0.3) lib/ahoy/controller.rb:45:in `set_ahoy_request_store'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
actiontext (7.1.3.4) lib/action_text/rendering.rb:23:in `with_renderer'
actiontext (7.1.3.4) lib/action_text/engine.rb:69:in `block (4 levels) in <class:Engine>'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `instance_exec'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:130:in `block in run_callbacks'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:141:in `run_callbacks'
actionpack (7.1.3.4) lib/abstract_controller/callbacks.rb:258:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/rescue.rb:25:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:74:in `block in process_action'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:19:in `block in instrument'
activesupport (7.1.3.4) lib/active_support/notifications/instrumenter.rb:58:in `instrument'
appsignal (3.2.1) lib/appsignal/hooks/active_support_notifications.rb:18:in `instrument'
actionpack (7.1.3.4) lib/action_controller/metal/instrumentation.rb:73:in `process_action'
actionpack (7.1.3.4) lib/action_controller/metal/params_wrapper.rb:261:in `process_action'
activerecord (7.1.3.4) lib/active_record/railties/controller_runtime.rb:32:in `process_action'
actionpack (7.1.3.4) lib/abstract_controller/base.rb:160:in `process'
actionview (7.1.3.4) lib/action_view/rendering.rb:40:in `process'
actionpack (7.1.3.4) lib/action_controller/metal.rb:227:in `dispatch'
actionpack (7.1.3.4) lib/action_controller/metal.rb:309:in `dispatch'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:32:in `serve'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:51:in `block in serve'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:131:in `block in find_routes'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:124:in `each'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:124:in `find_routes'
actionpack (7.1.3.4) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (7.1.3.4) lib/action_dispatch/routing/route_set.rb:882:in `call'
flipper (1.3.0) lib/flipper/middleware/memoizer.rb:87:in `memoized_call'
flipper (1.3.0) lib/flipper/middleware/memoizer.rb:45:in `call'
bullet (7.1.6) lib/bullet/rack.rb:17:in `call'
logtail-rails (0.2.6) lib/logtail-rails/error_event.rb:24:in `call'
logtail-rack (0.2.5) lib/logtail-rack/http_events.rb:213:in `call'
logtail-rack (0.2.5) lib/logtail-rack/user_context.rb:71:in `block in call'
logtail (0.1.13) lib/logtail/current_context.rb:120:in `with'
logtail (0.1.13) lib/logtail/current_context.rb:44:in `with'
logtail-rack (0.2.5) lib/logtail-rack/user_context.rb:70:in `call'
logtail-rails (0.2.6) lib/logtail-rails/session_context.rb:16:in `call'
logtail-rack (0.2.5) lib/logtail-rack/http_context.rb:23:in `block in call'
logtail (0.1.13) lib/logtail/current_context.rb:120:in `with'
logtail (0.1.13) lib/logtail/current_context.rb:44:in `with'
logtail-rack (0.2.5) lib/logtail-rack/http_context.rb:22:in `call'
warden (1.2.9) lib/warden/manager.rb:36:in `block in call'
warden (1.2.9) lib/warden/manager.rb:34:in `catch'
warden (1.2.9) lib/warden/manager.rb:34:in `call'
rack (2.2.8.1) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.2.8.1) lib/rack/etag.rb:27:in `call'
rack (2.2.8.1) lib/rack/conditional_get.rb:27:in `call'
rack (2.2.8.1) lib/rack/head.rb:12:in `call'
actionpack (7.1.3.4) lib/action_dispatch/http/permissions_policy.rb:36:in `call'
actionpack (7.1.3.4) lib/action_dispatch/http/content_security_policy.rb:33:in `call'
rack (2.2.8.1) lib/rack/session/abstract/id.rb:266:in `context'
rack (2.2.8.1) lib/rack/session/abstract/id.rb:260:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/cookies.rb:689:in `call'
activerecord (7.1.3.4) lib/active_record/migration.rb:655:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (7.1.3.4) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (7.1.3.4) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/actionable_exceptions.rb:16:in `call'
appsignal (3.2.1) lib/appsignal/rack/rails_instrumentation.rb:32:in `call_with_appsignal_monitoring'
appsignal (3.2.1) lib/appsignal/rack/rails_instrumentation.rb:17:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (7.1.3.4) lib/rails/rack/logger.rb:37:in `call_app'
railties (7.1.3.4) lib/rails/rack/logger.rb:26:in `call'
ahoy_matey (4.0.3) lib/ahoy/engine.rb:22:in `call_with_quiet_ahoy'
sprockets-rails (3.5.1) lib/sprockets/rails/quiet_assets.rb:17:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
request_store (1.5.1) lib/request_store/middleware.rb:19:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/request_id.rb:28:in `call'
rack (2.2.8.1) lib/rack/method_override.rb:24:in `call'
rack (2.2.8.1) lib/rack/runtime.rb:22:in `call'
activesupport (7.1.3.4) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/static.rb:25:in `call'
rack (2.2.8.1) lib/rack/sendfile.rb:110:in `call'
actionpack (7.1.3.4) lib/action_dispatch/middleware/host_authorization.rb:141:in `call'
rack-cors (1.1.1) lib/rack/cors.rb:100:in `call'
railties (7.1.3.4) lib/rails/engine.rb:536:in `call'
puma (5.6.8) lib/puma/configuration.rb:252:in `call'
puma (5.6.8) lib/puma/request.rb:77:in `block in handle_request'
puma (5.6.8) lib/puma/thread_pool.rb:340:in `with_force_shutdown'
puma (5.6.8) lib/puma/request.rb:76:in `handle_request'
puma (5.6.8) lib/puma/server.rb:443:in `process_client'
puma (5.6.8) lib/puma/thread_pool.rb:147:in `block in spawn_thread'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment