dimanche 22 février 2015

Dynamic rails controllers and views without any code

I am looking for ways to reduce the default code for models, controllers and views.


I have just created a model SearchDescription with two fields and with a controller and view. I need the default scaffolded index,show etc. Also the rspecs, but again completely default. Nothing special. Just the default.


But as it turned out I am current committing some 20 files that are with a completely default behaviour. Nothing special.


Is there a way to do it cleaner with less code actually being generated in the project, but rather "dynamically generated"?


For example just write the following thing in a config file: SearchDescription, field1, field2; with Controller; with views; with rspecs


and have this work by convention without actually generating the files?


Aucun commentaire:

Enregistrer un commentaire