Skip to content

Commit

Permalink
Add configuration section
Browse files Browse the repository at this point in the history
  • Loading branch information
hopsoft committed May 22, 2024
1 parent 2d8c259 commit d6672ac
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</h1>
<p align="center">
<a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/">
<img alt="Lines of Code" src="https://img.shields.io/badge/loc-1689-47d299.svg" />
<img alt="Lines of Code" src="https://img.shields.io/badge/loc-1735-47d299.svg" />
</a>
<a href="https://codeclimate.com/github/hopsoft/turbo_boost-commands/maintainability">
<img src="https://api.codeclimate.com/v1/badges/fe1162a742fe83a4fdfd/maintainability" />
Expand Down Expand Up @@ -63,6 +63,7 @@
- [Sponsors](#sponsors)
- [Dependencies](#dependencies)
- [Setup](#setup)
- [Configuration](#configuration)
- [Usage](#usage)
- [Event Delegates](#event-delegates)
- [Lifecycle Events](#lifecycle-events)
Expand Down Expand Up @@ -171,6 +172,33 @@ rails app:template LOCATION='https://railsbytes.com/script/xkjsbB'
+import '@turbo-boost/commands'
```

## Configuration

TurboBoost Commands should be configured via a Rails initializer.

```ruby
# config/initializers/turbo_boost_commands.rb
TurboBoost::Commands.config.tap do |config|
# opt-[in/out] of alerting on abort (true, *false, "development", "test", "production")
config.alert_on_abort = false

# opt-[in/out] of alerting on error (true, *false, "development", "test", "production")
config.alert_on_error = false

# opt-[in/out] of including precompiling TurboBoost assets (*true, false)
config.precompile_assets = true

# opt-[in/out] of forgery protection (true, *false)
config.protect_from_forgery = true

# opt-[in/out] of raising an error when an invalid command is invoked (true, false, *"development", "test", "production")
config.raise_on_invalid_command = "development"

# opt-[in/out] of state resolution (true, *false)
config.resolve_state = false
end
```

## Usage

This example illustrates how to use TurboBoost Commands to manage upvotes on a Post.
Expand Down

0 comments on commit d6672ac

Please sign in to comment.