Skip to content

Instantly share code, notes, and snippets.

@frullah
Last active July 19, 2021 13:04
Show Gist options
  • Save frullah/17a90fea9e3181cd6e53c853a8b1bbda to your computer and use it in GitHub Desktop.
Save frullah/17a90fea9e3181cd6e53c853a8b1bbda to your computer and use it in GitHub Desktop.
Rails scaffold helpers docs

Rails Scaffold

Template

if you use erb, template files should be in lib/templates/erb/scaffold

if you use slim, template files should be in lib/templates/slim/scaffold

the template file will evaluate erb tag, if you don't want to evaluate it, use double % (<%% ... %%>)

singular_table_name -> String

resource table name in singular form

attributes -> Array<Rails::Generators::GeneratedAttribute>

Rails::Generators::GeneratedAttribute

index_helper -> String

return resource index route name

singular_route_name -> String

return resource route name in singular form

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment