sourcelabsllc / administrate_batch_actions Goto Github PK
View Code? Open in Web Editor NEWBatch actions for Administrate plugin
License: MIT License
Batch actions for Administrate plugin
License: MIT License
Route generation does not take into account a customized namespace.
The controller method SitesController#export_batch_action
is undefined when rendering app/views/admin/application/index.html.erb
Context: Ruby 2.7.5, Rails 6.1.4.4, Administrate 0.16.0
Comparing all changes between main and administrate_batch_actions branches:
https://github.com/stepheneb/wts-rails6/compare/main...administrate_batch_actions
ActionView::Template::Error (undefined local variable or method `export_batch_action' for #<ActionView::Base:0x0000000000b2c0>
Did you mean? export_batch_action_admin_sites_url):
34:
35: <%=
36: administrate_batch_actions_button(
37: export_batch_action,
38: export_batch_action_admin_sites_path,
39: { class: '', confirm: '' }
40: )
app/views/admin/application/index.html.erb:37
In the interactive console under the view error and asking for tab completion on in-scope objects starting with export
.
>> export
export_batch_action_admin_sites_path export_batch_action_admin_sites_url
My controller with a method named: export_batch_action
module Admin
class SitesController < Admin::ApplicationController
def export_batch_action
Site.find(params[:batch_action_ids]).each(&:export)
redirect_to :admin_sites, notice: "Successfully exported #{params[:batch_action_ids].size} sites"
end
end
end
And model with a Site#export
method
class Site < ApplicationRecord
def export
end
end
When updating administrate_batch_actions from 0.3.1 to 0.3.4, the batch actions got renamed, for example, from merge_batch_action_admin_albums
to merge_batch_action_albums
. Somehow the admin namespace was lost?
Please take a look at the original implementation PR and see if you can get the router working.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.