Repository navigation
Support custom namespaces, preserve button query params, clarify README - #50
Merged
Merged
Conversation
- Add AdministrateBatchActions.namespace (symbol or array, default :admin) so batch action routes are generated for controllers outside app/controllers/admin (#11) - Build the batch action URL with the URL API so existing query params are kept and repeated clicks don't append duplicate ids (#45) - Clarify that the button helper's first argument is a string label (#12) - Update README/CHANGELOG for the route scheme introduced in #47/#49, which fixed the missing admin namespace (#42)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #11, closes #12, closes #42, closes #45.
Changes
AdministrateBatchActions.namespacesetting (symbol or array, default:admin). Controllers under each namespace get routes using the scheme from Ensure batch routes are generated under the :admin scope #47/Ensure route collisions don't occur withadmin/controller/batch_actionandadmin/controller/:id(#show) #49, e.g.Backoffice::WidgetsController#archive_batch_action→backoffice_archive_batch_action_widgetsatPOST /backoffice/administrate_batch_actions/widgets/archive_batch_action.URL/searchParams, so query params already on the button are kept. It also starts from the original href on every click, so cancelling the confirm and clicking again doesn't append the ids twice.batch_action_nameplaceholder that looked like a method call. It now passes a string label.admin/controller/batch_actionandadmin/controller/:id(#show) #49. This PR updates the README route examples (which still showed the olddelete_batch_action_admin_usersname) and adds the changelog entry.Notes
admin/controller/batch_actionandadmin/controller/:id(#show) #49 renames every route (e.g.admin_delete_batch_action_users_path), so the next release should probably be 0.5.0 rather than a patch./admin.Testing
bundle exec rspec: 9 examples, 0 failures (adds a custom-namespace route spec)