Friday, July 12, 2013

Rails - customizing 'scaffold' generator

In 'lib' folder, create the following folders: templates > erb > scaffold

Create index.html.erb and other files here (i.e. in 'scaffold' folder)
(The default versions of the above files that come with 'rails' are here - for v3.2.13 - https://github.com/rails/rails/tree/v3.2.13/railties/lib/rails/generators/erb/scaffold/templates )

Railscast about Generators - http://railscasts.com/episodes/216-generators-in-rails-3?view=comments
(Watch from 8mins onwards for customizing info)

Other useful links related to Generators-
http://stackoverflow.com/questions/4333393/using-rails-generate-scaffold-when-model-already-exists?rq=1
http://stackoverflow.com/questions/4630911/override-default-scaffold-generator-in-rails-3
http://stackoverflow.com/questions/8688220/rails-3-1-changing-default-scaffold-views-and-template
http://guides.rubyonrails.org/generators.html

No comments:

Post a Comment

Followers

Blog Archive