# Getting error ActionController::RoutingError (uninitialized constant )

**URL:** https://meta.discourse.org/t/getting-error-actioncontroller-routingerror-uninitialized-constant/267366
**Category:** Development
**Created:** [June 6, 2023, 8:28am UTC](https://meta.discourse.org/t/getting-error-actioncontroller-routingerror-uninitialized-constant/267366 "2023-06-06T08:28:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Yogesh\_Kbizsoft](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yogesh_kbizsoft/32/297602_2.png) [@Yogesh\_Kbizsoft](https://meta.discourse.org/u/Yogesh_Kbizsoft)
#### Post date: [June 6, 2023, 8:28am UTC](https://meta.discourse.org/t/getting-error-actioncontroller-routingerror-uninitialized-constant/267366/1 "2023-06-06T08:28:24Z")

</div>

Getting

```plaintext
errorActionController::RoutingError (uninitialized constant DeleteUserPostsController)
lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:369:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/request_tracker.rb:228:in `call'

```

This is my code := plugin.rb

```rb
after_initialize do
    Discourse::Application.routes.append do
      get '/admin/plugins/delete_all_posts' => 'delete_user_posts#delete_test'
  end
end

```

controller := app/controllers/delete\_user\_posts\_controller.rb

```rb
class DeleteUserPostsController < ApplicationController
    def delete_test
      # Trigger the execution of the DeleteUserPosts job here
      Jobs::DeleteUserPosts.new.execute({}) # Pass any necessary arguments to the execute method
  
      render json: { message: 'Job triggered successfully' }
    end
end
  

```

Any help will be appriciated. its frustating I am stucked at this from month.
