railties
Railties
To edit the scaffold templates, look up the location of the railties gem with “gem info railties”
Within the location above, edit the templates in the subdirectories:
- gems/railties-(version-here)/lib/rails/generators/erb/scaffold
- gems/railties-(version-here)/lib/rails/generators/rails/scaffold_controller/templates/controller.rb.tt
To generate dropdowns for referenced attributes, use the following code:
<%- if attribute.reference? -%> <%%= f.label :<%= attribute.column_name %> %><br> <%%= f.collection_select :<%= attribute.column_name %>, <%= attribute.name.camelize %>.all, :id, :name, prompt: true %> <%- else -%>
railties.txt · Last modified: by reddy
