Skip to content

Commit

Permalink
The explanation for assigns_to_attributes should show you what to exp…
Browse files Browse the repository at this point in the history
…ect (#2012)
  • Loading branch information
krainboltgreene committed May 8, 2022
1 parent 081056a commit ed409f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/phoenix_live_view/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,13 @@ defmodule Phoenix.LiveView.Helpers do
</a>
"""
end
The above would result in the following rendered HTML:
<a href="/" target="_blank" id="1" class="my-class">Home</a>
The optional second argument to `assigns_to_attributes` takes a list of keys to exclude
which will typically be the keys reserved by the component itself which either
The second argument (optional) to `assigns_to_attributes` is a list of keys to
exclude. It typically includes reserved keys by the component itself, which either
do not belong in the markup, or are already handled explicitly by the component.
'''
def assigns_to_attributes(assigns, exclude \\ []) do
Expand Down

0 comments on commit ed409f2

Please sign in to comment.