Overriding Camelization of ActionController Name

Hi all,

I have a controller that I wanted named KETaskController, defined in
the file ke_task_controller.rb, but Rails wants to reference the
controller class as KeTaskController. Specifically, my controller
class is defined as:

class KETaskController < ApplicationController

but Rails expects something different according to its naming
conventions:

LoadError (Expected script/…/config/…/app/controllers/
ke_task_controller.rb to define KeTaskController)

Now, I can see where I can override pluralization rules for singular
nouns, but I don’t know where I can tweak the camelization of a
specific controller name.

It’s not a huge deal – I could just use KeTaskController – but
that’s a bit confusing because KE stands for Knowledge Engineering in
this app.

Any thoughts? Many thanks,

  • David

On Jun 16, 10:49 am, David B. [email protected]
wrote:

Hi all,

I have a controller that I wanted named KETaskController, defined in
the file ke_task_controller.rb, but Rails wants to reference the
controller class as KeTaskController. Specifically, my controller
class is defined as:

class KETaskController < ApplicationController

I think you can just name file file k_e_task_controller.rb, since the
camelization is based on the position of the underscores.

Jeff
softiesonrails.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs