https://github.com/grace-plugins/grace-inertia
Grace Plugin for using Grace app with Inertia.js
https://github.com/grace-plugins/grace-inertia
grace grace-plugin graceframework grails inertiajs
Last synced: 3 months ago
JSON representation
Grace Plugin for using Grace app with Inertia.js
- Host: GitHub
- URL: https://github.com/grace-plugins/grace-inertia
- Owner: grace-plugins
- Created: 2024-04-25T18:15:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-05T08:20:16.000Z (3 months ago)
- Last Synced: 2025-07-05T09:24:22.438Z (3 months ago)
- Topics: grace, grace-plugin, graceframework, grails, inertiajs
- Language: Groovy
- Homepage: https://plugins.graceframework.org/grace-inertia/latest/
- Size: 573 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/grace-plugins/grace-inertia/actions?query=workflow%3A%Grace+CI%22)
[](https://opensource.org/licenses/Apache-2.0)
[](https://search.maven.org/search?q=g:org.graceframework.plugins)
[](https://plugins.graceframework.org/grace-inertia/latest/)
[](https://x.com/graceframework)[](https://groovy-lang.org/releasenotes/groovy-3.0.html)
[](https://github.com/graceframework/grace-framework/releases/tag/v2022.2.8)# Grace with Inertia
Grace Plugin for using Grace/Grails app with [Inertia.js](https://inertiajs.com).
## Ducumentation
* [Latest](https://plugins.graceframework.org/grace-inertia/latest/)
## Usage
Add dependency to the `build.gradle`,
```gradle
repositories {
mavenCentral()
}dependencies {
implementation "org.graceframework.plugins:inertia:VERSION"
}
```Inertia plugin supports controller-specific `withFormat()` method,
```groovy
class BookController {def list() {
def books = Book.list()withFormat {
inertia {
render(inertia: "Book/List", props: [bookList: books])
}
json {
render books as JSON
}
}
}
}
```Also, this plugin supports extendsions for Grails Request and Response,
```groovy
// You can get Inertia request headers from Grails Requestrequest.inertia.version == request.getHeader('X-Inertia-Version')
// Check Inertia request?
if (request.inertia as boolean) { // or use request.isInertia()
template = 'book-detail'
}// You can set Inertia response headers in Grails
response.inertia.location = 'http://localhost:8080/book/1'
```
## Development
### Build from source
```
git clone https://github.com/grace-plugins/grace-inertia.git
cd grace-inertia
./gradlew publishToMavenLocal
```## Support Version
* Grace 2022.0.0+
* Grails 5.0+## Roadmap
### 1.x
* Inertia 1.x
## License
This plugin is available as open source under the terms of the [APACHE LICENSE, VERSION 2.0](http://apache.org/Licenses/LICENSE-2.0)
## Links
- [Grace Framework](https://github.com/graceframework/grace-framework)
- [Grace Plugins](https://github.com/grace-plugins)
- [Grace Inertia Plugin](https://github.com/grace-plugins/grace-inertia)
- [Inertia](https://inertiajs.com)