Skip to content

Commit

Permalink
fix(deps): adapt naming to match phlex 1.10+ (#5)
Browse files Browse the repository at this point in the history
⚠️ [DEPRECATION] Defining the `template` method on a Phlex component will not be supported in Phlex 2.0. Please rename `Phlex::Heroicons::Base#template` to `Phlex::Heroicons::Base#view_template` instead.
  • Loading branch information
mhenrixon authored Aug 7, 2024
1 parent 7e67b29 commit 59ac37f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24

DEPENDENCIES
minitest (~> 5.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Hello < Phlex::HTML
@name = name
end

def template
def view_template
div do
render Phlex::Heroicons::HandRaised.new(variant: :solid, classes: 'h-4 w-4')
h1 { "Hello #{@name}!" }
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/heroicons/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(variant: Phlex::Heroicons.configuration.default_variant, classes:
@classes = classes
end

def template
def view_template
send(variant) if respond_to?(variant)
end
end
Expand Down

0 comments on commit 59ac37f

Please sign in to comment.