Skip to content

Commit

Permalink
make app_layout_component.rb sample easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
fkchang committed Apr 30, 2024
1 parent 0440135 commit 56dd993
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions app_layout_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,24 @@ def codemirror_attach
end

# Sample invocation:
# code = "class UserProfileComponent < Phlex::HTML\n def initialize(user)\n @user = user\n end\n\n def view_template\n div {\n h1 { @user.name }\n p { @user.email }\n }\n end\nend"
# params = "UserProfileComponent.new(User.new('John Doe', '[email protected]')) "
# code = <<~RUBY
# class UserProfileComponent < Phlex::HTML
# def initialize(user)
# @user = user
# end

# def view_template
# div {
# h1 { @user.name }
# p { @user.email }
# }
# end
# end
# RUBY
# params = <<~RUBY
# user = Object.new
# def user.name = 'John Doe'
# def user.email = '[email protected]'
# RUBY
# AppLayoutComponent.new(code, params)
# End Sample invocation

0 comments on commit 56dd993

Please sign in to comment.