Custom additional action on actions column on index page
Created by: bekicot
-
What would you like to be able to do? Can you provide some examples? Custom additional action on actions column on the index page
-
How could we go about implementing that? The simplest way is to move the actions column into partial so that the user can override just the actions column part of the table. Instead of overriding the whole
collection
partial. We also need to update the column heading count to also account for the additional custom action.
Another approach is probably to add ability to add an action button via the dashboard class.
# CarDashboard.rb
ACTIONS = [:start, :stop, :destroy, :show]
# CarController.rb
def start
resource.start!
end
- Can you think of other approaches to the problem?
Currently, we can override the whole
collection
partial. But it will lead to a greater incompatibility upon updating administrate.