Skip to content

Fix docs #204

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

Merged
merged 1 commit into from
Apr 1, 2025
Merged
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
5 changes: 3 additions & 2 deletions docs/guide/responses.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ With this configuration, the `app/frontend/pages/events/index.(jsx|vue|svelte)`

If the default component path doesn't match your convention, you can define a custom resolution method via the `component_path_resolver` config value. The value should be callable and will receive the path and action parameters, returning a string component path.

````ruby
```ruby
inertia_config(
component_path_resolver: ->(path:, action:) do
"Storefront/#{path.camelize}/#{action.camelize}"
end
)
```

## Root template data

Expand All @@ -106,7 +107,7 @@ There are situations where you may want to access your prop data in your ERB tem
<% end %>

<div id="app" data-page="<%= page.to_json %>"></div>
````
```

Sometimes you may even want to provide data to the root template that will not be sent to your JavaScript page / component. This can be accomplished by passing the `view_data` option.

Expand Down