Everything worked fine. The code in that place did not touch for several months.

Swears specifically on this block of code:

batch_action :publish do |selections| News.find(selections).each do |news| News.find(news).toggle!(:published) end redirect_to admin_news_index_path end 

If you leave only these two lines:

 batch_action :publish do |selections| # ... end 

That will not change anything - the error persists.

What can be the reason, if I don’t touch all the files related to the ActiveAdmin gem?

Touched only this: bundle update and install and worked with ActionCable.

Moreover, in my batch_action almost all sections have batch_action . And everything works fine there.

    2 answers 2

    I have the same problem. This happens because of the incorrect generation of routes. Model and resource - News. The route for the index page is generated by batch_action_admin_news_index_path , and tries to batch_action_admin_news_path by batch_action_admin_news_path . I have not found a solution yet. Looking for what you can do. A temporary solution is to rename a resource (let's say on NewsPage). official documentation

    UPD: Repaired. It all boils down to what Inherited Resources needs to override the default names for routes (since it seems to be tight with models like News). In the admin resource config, you need to add / correct in the controller block:

     ActiveAdmin.register News do controller do defaults :route_collection_name => 'news_index', :route_instance_name => 'news' end end 

    Inherited resources docs

    • Yes. That helped. But the question remains: "Why did this happen now, after so much time?" ActiveAdmin (like) has not been updated recently ... - Colibri
    • I have no idea :) I undertook to update the project 3 years ago and came across this bug. Now I have an actual master . Also, if you suddenly come across a problem with the loss of gradient backgrounds on buttons and other admin elements, this is because AA bourbon for gradients uses the linear-gradient bourbon function (well, that is, it no longer exists and it doesn’t use anything: -D) ZY Make it an issue on the githabab for our problem. Maybe someone else will help the decision. - mindhalt
    • Do you have a problem with pagination? And then I have each button looks like 5 (current) plus, therefore, the current page is not highlighted. True, this bug got out a long time, but it doesn’t bother much. - Colibri
    • With pagination has not yet encountered problems. Try to see if everything is correct in i18n configs. Or read the dock for kaminari (it is responsible for their pagination), - maybe there is someone with a similar problem in the issues in the kaminari repository. - mindhalt

    bundle update by default updates ALL gemы to the latest allowed (in Gemfile ) version. Try to roll back all your changes and check the code again. git bisect works well for this.

    • Of course, I understand that I am far from a pro in Ruby, but I'm still not done with anything :) - Colibri