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

use helper_method for turbo_frame_request_id #417

Merged

Conversation

igorkasyanchuk
Copy link
Contributor

I want to remove redundant code from my controller because I need to know turbo_frame_request_id inside the view

@dhh
Copy link
Member

dhh commented Jun 20, 2023

Can you elaborate on the controller code you were able to simplify with this?

@igorkasyanchuk
Copy link
Contributor Author

it basically removes the variable @frame_id = turbo_frame_request_id from the controller.

In case I need to render partial from different actions, or views I don't need to initialize it in the controller. So we have cleaner code and actually have to write less code.

@dhh dhh merged commit 5e9bc1f into hotwired:main Jun 24, 2023
@igorkasyanchuk igorkasyanchuk deleted the add_turbo_frame_request_id_the_views branch June 26, 2023 08:58
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.

None yet

2 participants