Skip to content

Commit

Permalink
Fix generate configuration (ViewComponent#1672)
Browse files Browse the repository at this point in the history
* Fix generate configuration

The previous configurations are not working any more. The `generate_....` notation was replaced with a `generate. ...` object.

* add changelog

---------

Co-authored-by: Joel Hawksley <[email protected]>
  • Loading branch information
kulturbande and joelhawksley authored Mar 8, 2023
1 parent 0a7a372 commit 822f800
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nav_order: 5

## main

* Fix typos in generator docs.

*Sascha Karnatz*

* Add `TestHelpers#vc_test_controller`.

*Joel Hawksley*
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bin/rails generate component Example title --stimulus
create app/components/example_component.html.erb
```

To always generate a Stimulus controller, set `config.view_component.generate_stimulus_controller = true`.
To always generate a Stimulus controller, set `config.view_component.generate.stimulus_controller = true`.

### Generate [locale files](/guide/translations.html)

Expand All @@ -121,9 +121,9 @@ bin/rails generate component Example title --locale
create app/components/example_component.html.erb
```

To always generate locale files, set `config.view_component.generate_locale = true`.
To always generate locale files, set `config.view_component.generate.locale = true`.

To generate translations in distinct locale files, set `config.view_component.generate_distinct_locale_files = true` to generate as many files as configured in `I18n.available_locales`.
To generate translations in distinct locale files, set `config.view_component.generate.distinct_locale_files = true` to generate as many files as configured in `I18n.available_locales`.

### Place the view in a sidecar directory

Expand Down

0 comments on commit 822f800

Please sign in to comment.