resque / resque-web

a Rails-based web interface to Resque
235 stars 166 forks source link

Failed jobs can't be cleared #142

Closed typhoon2099 closed 5 years ago

typhoon2099 commented 6 years ago

I have created a new Rails 5 API only application and added Resque and Resque Web to manage jobs. When trying to cleared the failed jobs using the "Clear Failed Jobs" button on the Failed Jobs page I get the following Rails Routing error:

No route matches [POST] "/resque_web/failures/destroy_all"

Does Resque Web work when Rails is in API only mode?

EDIT: Disabling config.api_only restores the functionality of the button.

rahulnyk commented 5 years ago

Wondering if you were able to find a solution to this. I too have a rails API only app and I do not wish to disable api_only flag. Is there any better way to do this.

typhoon2099 commented 5 years ago

I have not. I have tried to override the controller but my solution was clumsy so I ditched it.

tylerkahn commented 5 years ago

If you add these two lines to your application.rb it will work:

config.middleware.use Rack::MethodOverride
config.middleware.use ActionDispatch::Flash
rafaelfranca commented 5 years ago

https://github.com/resque/resque/issues/1633#issuecomment-446636861

TheInfiniteBarnaby commented 5 years ago

If you add these two lines to your application.rb it will work:

config.middleware.use Rack::MethodOverride
config.middleware.use ActionDispatch::Flash

Thanks for this. Worked perfectly.