V2.2: Generate


hanami generate

Hanami 2.1 provides a few generators:

$ bundle exec hanami generate --help
Commands:
  hanami generate action NAME
  hanami generate part NAME
  hanami generate slice NAME
  hanami generate view NAME

hanami generate action

Generates an action:

$ bundle exec hanami generate action books.show

Use the --help option to access all accepted options:

$ bundle exec hanami generate action --help

hanami generate part

Generates a view part:

$ bundle exec hanami generate part book

Use the --help option to access all accepted options:

$ bundle exec hanami generate part --help

hanami generate slice

Generates a slice:

$ bundle exec hanami generate slice admin

Use the --help option to access all accepted options:

$ bundle exec hanami generate slice --help

hanami generate view

Generates a view:

$ bundle exec hanami generate view books.create

Use the --help option to access all accepted options:

$ bundle exec hanami generate view --help