简体   繁体   中英

Rails generate a controller with different inheritance than Application

Anybody know a shortcut way of generating a controller that inherits from something different than ApplicationController?

I currently run:

rails g controller Admin::Food

but it creates

class Admin::FoodsController < ApplicationController

when I actually want:

class Admin::FoodsController < AdminController

Thanks!

The Rails controller generator will not allow you to specify the superclass. You will need to edit this file and set the superclass manually.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM