From 2969e0bc2a34f3ae2959b08b08ad718bf057a69d Mon Sep 17 00:00:00 2001 From: David Alejandro <15317732+davidalejandroaguilar@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:05:58 +0000 Subject: [PATCH] Add explanation of why you could include PhlexyUI in ApplicationComponent --- app/views/docs/installations/show_view.rb | 32 ++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/app/views/docs/installations/show_view.rb b/app/views/docs/installations/show_view.rb index 772b789..bf608c3 100644 --- a/app/views/docs/installations/show_view.rb +++ b/app/views/docs/installations/show_view.rb @@ -183,7 +183,7 @@ def render_ruby_dependencies_section end p do - "2. Include the PhlexyUI module in ApplicationComponent:" + "2. (Optional) Include the PhlexyUI module in ApplicationComponent:" end Code(:ruby, source: <<~RB) do @@ -193,6 +193,36 @@ class ApplicationComponent < Phlex::HTML RB end + p do + "Including PhlexyUI is necessary if you want to use PhlexyUI components using the short-form syntax provided by Phlex::Kit. For example:" + end + + Code(:ruby, source: <<~RB) do + class SomeView < ApplicationView + def view_template + Button :primary do + "Hello, world!" + end + end + end + RB + end + + p do + "If you don't include PhlexyUI in ApplicationComponent, you can use the long-form syntax:" + end + + Code(:ruby, source: <<~RB) do + class SomeView < ApplicationView + def view_template + PhlexyUI::Button :primary do + "Hello, world!" + end + end + end + RB + end + p do "3. Update your tailwind.config.js file to include PhlexyUI styles:" end