From d6672ac1c05791f23742d7cf673280357f9a81dc Mon Sep 17 00:00:00 2001 From: "Nate Hopkins (hopsoft)" Date: Wed, 22 May 2024 14:32:20 -0600 Subject: [PATCH] Add configuration section --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d00f6367..706b4ef2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@

- Lines of Code + Lines of Code @@ -63,6 +63,7 @@ - [Sponsors](#sponsors) - [Dependencies](#dependencies) - [Setup](#setup) + - [Configuration](#configuration) - [Usage](#usage) - [Event Delegates](#event-delegates) - [Lifecycle Events](#lifecycle-events) @@ -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.