Question

I'm new with node and compound. While i tried to scaffold

compound g crud leaveApplication leave_code:string description:string applicable:string carry_forward:boolean limit_type:boolean lop:boolean od:boolean co:boolean leave_revision:boolean active:boolean

I was getting some errors, then i tried

compound g crud leave code:string description:string applicable:string cForward:boolean limit:boolean lop:boolean od:boolean co:boolean leave_revision:boolean active:boolean

But the error now occurred was in the name of routes

        leaves GET    /leaves.:format?                     leaves#index
        leaves POST   /leaves.:format?                     leaves#create
     new_leafe GET    /leaves/new.:format?                 leaves#new
    edit_leafe GET    /leaves/:id/edit.:format?            leaves#edit
         leafe DELETE /leaves/:id.:format?                 leaves#destroy
         leafe PUT    /leaves/:id.:format?                 leaves#update
         leafe GET    /leaves/:id.:format?                 leaves#show

These were the routes i was getting.

Why is that so?

Was it helpful?

Solution

it looks like compound is turning your model name into plural (=leaves) and then, instead of using your provided singular name, turning this plural name back, resulting in "leaf".

Does this make any sense? ;-) Or did I get you question wrong?

If you could provide the "some errors" and the full error message, it would be easier to help ;)

Btw, I just experienced that using camel case for models doesn't seem to be a good idea with compound.js. It's mangeling the camelcase in some places (e.g. inside the controllers), but in others not (schema.js) creating a application with some errors...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top