From 8e545ad8ad4c456d03d45cbce7408349c2190ac0 Mon Sep 17 00:00:00 2001 From: Joel Warrington Date: Mon, 17 Jun 2024 13:18:41 -0600 Subject: [PATCH] Improve README from feedback --- README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index acf16d5..79f270a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,14 @@ bundle add view_component-form ### Configuration +```ruby +# config/initializers/vcf.rb + +ViewComponent::Form.configure do |config| + config.parent_component = 'ApplicationFormComponent' +end +``` + | Attribute | Purpose | Default | | --------------------------- | ----------------------------------------------------- | ----------------------- | | `parent_component` (string) | Parent class for all `ViewComponent::Form` components | `"ViewComponent::Base"` | @@ -135,8 +143,8 @@ Add your component which can optionally inherit from: - or any of the `ViewComponent::Form::*Component` such as `ViewComponent::Form::TextFieldComponent` ```rb -# -class YearFieldComponent < ViewComponent::Form::FieldComponent # or ViewComponent::Form::BaseComponent +# app/components/form/year_field_component.rb +class Form::YearFieldComponent < ViewComponent::Form::FieldComponent # or ViewComponent::Form::BaseComponent end ``` @@ -183,11 +191,22 @@ en: Renders: ```html -
+
```