Skip to content

Commit

Permalink
Add explanation of why you could include PhlexyUI in ApplicationCompo…
Browse files Browse the repository at this point in the history
…nent
  • Loading branch information
davidalejandroaguilar committed Oct 9, 2024
1 parent 9fed41e commit 2969e0b
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion app/views/docs/installations/show_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2969e0b

Please sign in to comment.