-
Notifications
You must be signed in to change notification settings - Fork 113
Description
I'm encountering an unusual issue and I'm not entirely sure if it's directly related to mission-control-job or another part of my application.
The problem arises when I add mount MissionControl::Jobs::Engine, at: "/jobs" to my routes.rb file. After this change, my application seems to ignore certain internationalization (i18n) files.
Specifically, when the i18n files are not loaded (and thus the locale isn't fully set), the _pagination_toolbar.html.erb partial works correctly. However, once the locale is properly set and the i18n files are loaded, the same partial then throws the error: "arguments passed to url_for can't be handled. Please require routes or provide your own implementation."
Upon debugging, I've found that the options being passed to url_for in this scenario are ---options: {:page=>1}.
Now the error is only in production
Completed 500 Internal Server Error in 123ms (ActiveRecord: 4.9ms (50 queries, 40 cached) | GC: 5.1ms)
ActionView::Template::Error (arguments passed to url_for can't be handled. Please require routes or provide your own implementation)
Caused by: ArgumentError (arguments passed to url_for can't be handled. Please require routes or provide your own implementation)
Information for: ActionView::Template::Error (arguments passed to url_for can't be handled. Please require routes or provide your own implementation):
1: <nav class="buttons is-right" role="navigation" aria-label="pagination">
2: <span class="mr-3"><%= page.index %> / <%= page.pages_count || "..." %></span>
3: <%= link_to "Previous page", url_for(page: page.previous_index, **filter_param), class: "pagination-previous", disabled: page.first? %>
4: <%= link_to "Next page", url_for(page: page.next_index, **filter_param), class: "pagination-next", disabled: page.last? %>
5: </nav>
actionview (8.0.2) lib/action_view/helpers/url_helper.rb:45:in `url_for'
mission_control-jobs (1.0.2) app/views/mission_control/jobs/shared/_pagination_toolbar.html.erb:3
actionview (8.0.2) lib/action_view/base.rb:278:in `public_send'
actionview (8.0.2) lib/action_view/base.rb:278:in `_run'
actionview (8.0.2) lib/action_view/template.rb:284:in `block in render'
activesupport (8.0.2) lib/active_support/notifications.rb:212:in `instrument'
actionview (8.0.2) lib/action_view/template.rb:583:in `instrument_render_template'
actionview (8.0.2) lib/action_view/template.rb:272:in `render'
actionview (8.0.2) lib/action_view/renderer/partial_renderer.rb:252:in `block in render_partial_template'
activesupport (8.0.2) lib/active_support/notifications.rb:212:in `instrument'
actionview (8.0.2) lib/action_view/renderer/partial_renderer.rb:246:in `render_partial_template'
actionview (8.0.2) lib/action_view/renderer/partial_renderer.rb:237:in `render'
actionview (8.0.2) lib/action_view/renderer/renderer.rb:78:in `render_partial_to_object'
actionview (8.0.2) lib/action_view/renderer/renderer.rb:49:in `render_partial'
actionview (8.0.2) lib/action_view/helpers/rendering_helper.rb:152:in `render'
mission_control-jobs (1.0.2) app/views/mission_control/jobs/jobs/index.html.erb:16
actionview (8.0.2) lib/action_view/base.rb:278:in `public_send'
actionview (8.0.2) lib/action_view/base.rb:278:in `_run'
actionview (8.0.2) lib/action_view/template.rb:284:in `block in render'