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

Yield created resource if block is given #2484

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

trevorrjohn
Copy link
Contributor

Creates an interface to allow you to trigger actions after a resource is created (for example run a background job).

Right now you can do this in the after_resource_created_path but it doesn't quite feel right to have a side affect in a method that is supposed to be determining the redirection path.

Copy link
Member

@nickcharlton nickcharlton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

It'd be great if we could add a mention of this to the docs somewhere (it's possible there's not an obvious place), if you could give that a go?

@trevorrjohn
Copy link
Contributor Author

@nickcharlton added a note in the docs.

This creates an interface to allow you to trigger actions after a
resource has been created (for example, run a background job).

Whilst this was previously possible by utilising
`after_resource_created_path`, this is much more pleasant.
@nickcharlton
Copy link
Member

Magic, thanks!

@nickcharlton nickcharlton merged commit cd3cb72 into thoughtbot:main Jan 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants