jriff
jriff

Reputation: 1977

Rails 3 scaffold generator alternative

I have looked at the Rails 3 scaffold generator and I would like to modify it a bit. I will make some changes to the controller and the views.

The modifications should be for admin style controllers so I do not want to override the scaffold generator with it - I need them both. Can I somehow make one called admin_scaffold without having to do a complete new scaffold generator?

Upvotes: 0

Views: 1258

Answers (1)

sethvargo
sethvargo

Reputation: 26997

Ryan Bates has made the nifty-generators. You could download his code from gitHub and modify it to suit your needs.

It's generally a bad idea to modify the source code of a framework. You should always use a plugin or hook to define your own custom "stuff". If you work on a development team, you'll make a lot of people angry...

You add hooks into a framework, you don't hack it and change source code. It's against convention and annoying to those you may work with. You also need to take into account future updates, your code could get overwritten or broken...

Upvotes: 1

Related Questions