Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs]Update document for changing view_component_path #1870

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ nav_order: 5

*Alexandre Ignjatovic*

* Update generators.md to clarify the way of changing `config.view_component.view_component_path`.

*Shozo Hatta*

* Improve docs about inline templates interpolation

*Hans Lemuet*
Expand Down
8 changes: 7 additions & 1 deletion docs/guide/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ bin/rails generate component Sections::Example title content

You can specify options when running the generator. To alter the default values project-wide, define the configuration settings described in [API docs](/api.html#configuration).

Generated ViewComponents are added to `app/components` by default. Set `config.view_component.view_component_path` to use a different path.
Generated ViewComponents are added to `app/components` by default. Set `config.view_component.view_component_path` to use a different path. Note that you need to add the same path to `config.eager_load_paths` as well.

```ruby
# config/application.rb
config.view_component.view_component_path = "app/views/components"
config.eager_load_paths << Rails.root.join("app/views/components")
```

### Override template engine

Expand Down
Loading