excid3 / madmin

A robust Admin Interface for Ruby on Rails apps

Home Page:https://github.com/excid3/madmin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NoMethodError: undefined method pagy_link_proc

Shpigford opened this issue · comments

Any resources index page is throwing an undefined method pagy_link_proc error.

Running the latest commits from Madmin in a Rails 7.2.0.alpha app.

Have explicitly called bundle update on both madmin and pagy.

NoMethodError in Madmin::Terms#index

Showing /Users/joshpigford/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/bundler/gems/madmin-247256623b0c/app/views/madmin/pagy/_nav.html.erb where line #7 raised:

undefined method `pagy_link_proc' for #<ActionView::Base:0x0000000000db60>
Did you mean?  pagy_info

Usage: link.call( page_number [, text [, extra_attributes_string ]])
-%>
<% link = pagy_link_proc(pagy) -%>
<%#                            -%><nav aria-label="pager" class="space-x-1 px-2 py-1" role="navigation">
<% if pagy.prev                -%>  <span><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous" class="text-white bg-indigo-500 rounded-2xl px-3 py-1.5"') %></span>
<% else                        -%>  <span class="text-gray-400 bg-gray-100 rounded-2xl px-3 py-1.5 cursor-not-allowed"><%== pagy_t('pagy.nav.prev') %></span>
Trace of template inclusion: #<ActionView::Template /Users/joshpigford/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/bundler/gems/madmin-247256623b0c/app/views/madmin/application/index.html.erb locals=[]>

Rails.root: /Users/joshpigford/Development/maybe-marketing

[madmin (247256623b0c) app/views/madmin/pagy/_nav.html.erb:7](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/base.rb:281:in `public_send'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/base.rb:281:in `_run'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/template.rb:275:in `block in render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:212:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/template.rb:573:in `instrument_render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/template.rb:263:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/partial_renderer.rb:252:in `block in render_partial_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `block in instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications/instrumenter.rb:58:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/partial_renderer.rb:237:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/renderer.rb:78:in `render_partial_to_object'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/renderer.rb:29:in `render_to_object'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/renderer.rb:24:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/helpers/rendering_helper.rb:37:in `block in render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/base.rb:308:in `in_rendering_context'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/helpers/rendering_helper.rb:33:in `render'](http://localhost:3000/madmin/terms#)
[madmin (247256623b0c) app/views/madmin/application/index.html.erb:62](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/base.rb:281:in `public_send'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/base.rb:281:in `_run'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/template.rb:275:in `block in render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:212:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/template.rb:573:in `instrument_render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/template.rb:263:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/template_renderer.rb:66:in `block (2 levels) in render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `block in instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications/instrumenter.rb:58:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/template_renderer.rb:60:in `block in render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/template_renderer.rb:76:in `block in render_with_layout'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `block in instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications/instrumenter.rb:58:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/template_renderer.rb:75:in `render_with_layout'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/template_renderer.rb:59:in `render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/template_renderer.rb:11:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/renderer.rb:58:in `render_template_to_object'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/renderer/renderer.rb:31:in `render_to_object'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/rendering.rb:135:in `block in _render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/base.rb:308:in `in_rendering_context'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/rendering.rb:134:in `_render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/streaming.rb:258:in `_render_template'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/rendering.rb:121:in `render_to_body'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/rendering.rb:186:in `render_to_body'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/renderers.rb:142:in `render_to_body'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/abstract_controller/rendering.rb:29:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/rendering.rb:167:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/instrumentation.rb:32:in `block (2 levels) in render'](http://localhost:3000/madmin/terms#)
[/Users/joshpigford/.rbenv/versions/3.1.3/lib/ruby/3.1.0/benchmark.rb:311:in `realtime'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/core_ext/benchmark.rb:14:in `ms'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/instrumentation.rb:32:in `block in render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/instrumentation.rb:101:in `cleanup_view_runtime'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activerecord/lib/active_record/railties/controller_runtime.rb:46:in `cleanup_view_runtime'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/instrumentation.rb:31:in `render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/implicit_render.rb:39:in `default_render'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/basic_implicit_render.rb:9:in `send_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/abstract_controller/base.rb:226:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/rendering.rb:193:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/abstract_controller/callbacks.rb:261:in `block in process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/callbacks.rb:121:in `block in run_callbacks'](http://localhost:3000/madmin/terms#)
[turbo-rails (2.0.5) lib/turbo-rails.rb:24:in `with_request_id'](http://localhost:3000/madmin/terms#)
[turbo-rails (2.0.5) app/controllers/concerns/turbo/request_id_tracking.rb:10:in `turbo_tracking_request_id'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/callbacks.rb:130:in `block in run_callbacks'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actiontext/lib/action_text/rendering.rb:25:in `with_renderer'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actiontext/lib/action_text/engine.rb:71:in `block (4 levels) in <class:Engine>'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/callbacks.rb:130:in `instance_exec'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/callbacks.rb:130:in `block in run_callbacks'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/callbacks.rb:141:in `run_callbacks'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/abstract_controller/callbacks.rb:260:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/rescue.rb:27:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/instrumentation.rb:77:in `block in process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `block in instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications/instrumenter.rb:58:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/notifications.rb:210:in `instrument'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/instrumentation.rb:76:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activerecord/lib/active_record/railties/controller_runtime.rb:39:in `process_action'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/abstract_controller/base.rb:163:in `process'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionview/lib/action_view/rendering.rb:40:in `process'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal.rb:227:in `dispatch'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_controller/metal.rb:310:in `dispatch'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/routing/route_set.rb:33:in `serve'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/journey/router.rb:53:in `block in serve'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/journey/router.rb:133:in `block in find_routes'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/journey/router.rb:126:in `each'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/journey/router.rb:126:in `find_routes'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/journey/router.rb:34:in `serve'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/routing/route_set.rb:879:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/tempfile_reaper.rb:20:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/etag.rb:29:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/conditional_get.rb:31:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/head.rb:15:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/http/permissions_policy.rb:38:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/http/content_security_policy.rb:36:in `call'](http://localhost:3000/madmin/terms#)
[rack-session (2.0.0) lib/rack/session/abstract/id.rb:272:in `context'](http://localhost:3000/madmin/terms#)
[rack-session (2.0.0) lib/rack/session/abstract/id.rb:266:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/cookies.rb:704:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activerecord/lib/active_record/migration.rb:674:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/callbacks.rb:31:in `block in call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/callbacks.rb:101:in `run_callbacks'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/callbacks.rb:30:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/executor.rb:16:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/debug_exceptions.rb:31:in `call'](http://localhost:3000/madmin/terms#)
[web-console (4.2.1) lib/web_console/middleware.rb:132:in `call_app'](http://localhost:3000/madmin/terms#)
[web-console (4.2.1) lib/web_console/middleware.rb:28:in `block in call'](http://localhost:3000/madmin/terms#)
[web-console (4.2.1) lib/web_console/middleware.rb:17:in `catch'](http://localhost:3000/madmin/terms#)
[web-console (4.2.1) lib/web_console/middleware.rb:17:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/show_exceptions.rb:32:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) railties/lib/rails/rack/logger.rb:41:in `call_app'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) railties/lib/rails/rack/logger.rb:29:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/remote_ip.rb:96:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/request_id.rb:33:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/method_override.rb:28:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/runtime.rb:24:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) activesupport/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/server_timing.rb:61:in `block in call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/server_timing.rb:26:in `collect_events'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/server_timing.rb:60:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/executor.rb:16:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/static.rb:27:in `call'](http://localhost:3000/madmin/terms#)
[rack (3.0.10) lib/rack/sendfile.rb:114:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) actionpack/lib/action_dispatch/middleware/host_authorization.rb:143:in `call'](http://localhost:3000/madmin/terms#)
[rails (087260d0fce3) railties/lib/rails/engine.rb:536:in `call'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/configuration.rb:272:in `call'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/request.rb:100:in `block in handle_request'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/thread_pool.rb:378:in `with_force_shutdown'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/request.rb:99:in `handle_request'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/server.rb:464:in `process_client'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/server.rb:245:in `block in run'](http://localhost:3000/madmin/terms#)
[puma (6.4.2) lib/puma/thread_pool.rb:155:in `block in spawn_thread'](http://localhost:3000/madmin/terms#)

Looks like this was a breaking change in Pagy 8: https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md#version-800

We'll have to update the gemspec to require 8+ now and update that code.

Fixed by 4eb3b41

Using pagy_nav should be more compatible with Pagy changes long-term since it's unlikely to receive breaking changes.

Thanks @excid3! Just updated and all is working now.