Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add explanatory image to outlets example #719

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

benkoshy
Copy link
Contributor

@benkoshy benkoshy commented Sep 7, 2023

Why?

To allow readers to more easily map up the controller names / classes.

(Context: I must have spent 1-2 hours trying to debug why my outlets were not being recognised. Hopefully this image will save someone.)

Here is the image:

link_controllers_and_classes_explanation

@marcoroth
Copy link
Member

marcoroth commented Sep 11, 2023

Thanks @benkoshy, this is great!

The pull request #647 makes the green part optional which should help to improve the situation a bit.

I was wondering if we should leave out the green part if we merge that PR, what do you think?

@benkoshy
Copy link
Contributor Author

I was wondering if we should leave out the green part if we merge that PR, what do you think?

  • If the outlet is optional, would it be unacceptable if I added a "optional" label to the image? I can always restructure the image to make things clearer etc.

  • Or another thought (just a thought - I do not know how practical or sensible this is):

yarn stimulus print_outlets app/controllers/js/search_controller.js

Which prints out the following:

<div data-controller="result" class="result">...</div>
<div data-controller="result" class="result">...</div>
<div data-controller="search" data-search-result-outlet=".result">...</div>

Now I can cut and paste - minimise those headaches / confusions which come from mapping all the names, and spelling them correctly. probably your PR obviates such a tool. IDK just thinking outside the box.

@benkoshy
Copy link
Contributor Author

image

Please let me know if this is unacceptable? Your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants