-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom additional action on actions column on index page #1676
Comments
I'd prefer two partials: one for the header and another for the record rows, both used from How do you feel about this? Would you be able to create a PR that splits the two partials out of that template? |
@pablobm I will find some time this weekend to tackle this one. Please assign this issue to me. |
also move actions into their own partials close thoughtbot#1676
also move actions into their own partials close thoughtbot#1676
also move actions into their own partials close thoughtbot#1676
also move actions into their own partials close thoughtbot#1676
Our collection tables show two actions for each record: "Edit" and "Destroy". What if we want to allow other actions? This involves overriding the whole collection template, which is messy and adds friction when upgrading to new versions of Administrate. We have some examples of this need in our issue tracker. For example: thoughtbot#1676 More selfishly, I want to add one such custom action in the changes I'm making to how the example app handles authorization :-P This PR splits the collection partial into new partials that can be more easily overridden by users.
Our collection tables show two actions for each record: "Edit" and "Destroy". What if we want to allow other actions? This involves overriding the whole collection template, which is messy and adds friction when upgrading to new versions of Administrate. We have some examples of this need in our issue tracker. For example: thoughtbot#1676 More selfishly, I want to add one such custom action in the changes I'm making to how the example app handles authorization :-P This PR splits the collection partial into new partials that can be more easily overridden by users.
Our collection tables show two actions for each record: "Edit" and "Destroy". What if we want to allow other actions? This involves overriding the whole collection template, which is messy and adds friction when upgrading to new versions of Administrate. We have some examples of this need in our issue tracker. For example: thoughtbot#1676 More selfishly, I want to add one such custom action in the changes I'm making to how the example app handles authorization :-P This PR splits the collection partial into new partials that can be more easily overridden by users.
Is there any progress on this? I am trying to add a custom action link to my dashboard and having issues with it. This is my route:
I am adding this link_to to my _collection.html.erb file for foo controller:
And I am getting the following error on the index page:
I would appreciate if you could tell me what I am missing here. |
@audyaver - In your specific case, I think that Administrate is not the problem. Your route definition looks wrong. You have this:
And I think it should be this:
To clarify: without the suffix "_path", as this is added automatically by Rails. In your example, you'd get the route helpers |
Re: this issue in general, there's some progress at #1998, which implements new partials to help with this. |
Our collection tables show two actions for each record: "Edit" and "Destroy". What if we want to allow other actions? This involves overriding the whole collection template, which is messy and adds friction when upgrading to new versions of Administrate. We have some examples of this need in our issue tracker. For example: thoughtbot#1676 More selfishly, I want to add one such custom action in the changes I'm making to how the example app handles authorization :-P This PR splits the collection partial into new partials that can be more easily overridden by users.
Our collection tables show two actions for each record: "Edit" and "Destroy". What if we want to allow other actions? This involves overriding the whole collection template, which is messy and adds friction when upgrading to new versions of Administrate. We have some examples of this need in our issue tracker. For example: #1676 More selfishly, I want to add one such custom action in the changes I'm making to how the example app handles authorization :-P This PR splits the collection partial into new partials that can be more easily overridden by users.
Our collection tables show two actions for each record: "Edit" and "Destroy". What if we want to allow other actions? This involves overriding the whole collection template, which is messy and adds friction when upgrading to new versions of Administrate. We have some examples of this need in our issue tracker. For example: thoughtbot/administrate#1676 More selfishly, I want to add one such custom action in the changes I'm making to how the example app handles authorization :-P This PR splits the collection partial into new partials that can be more easily overridden by users.
This should be fixed now after merging #1998. I have added it to the list of stuff to document. |
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.
Currently, we can override the whole
collection
partial. But it will lead to a greater incompatibility upon updating administrate.The text was updated successfully, but these errors were encountered: