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

How to call transitions from controllers/api #57

Open
f-g-p opened this issue Feb 20, 2023 · 0 comments
Open

How to call transitions from controllers/api #57

f-g-p opened this issue Feb 20, 2023 · 0 comments

Comments

@f-g-p
Copy link

f-g-p commented Feb 20, 2023

Hi,

I had a question regarding how to handle state transitions initiated from controllers.

before using state machines, we had very simple update code in controllers, basically object.update(object_params) where object_params was a hash that could potentially contain a status key with the new value.

We are not supposed to use this anymore, so I wanted to know what you would suggest as the best way to handle it.
My feeling is that possible transitions should be exposed up to the views, and that we should only be working with that.
In the case of API controllers, we might want to update some parameters, and we definitely want to do this in a single call to our back end.
We also would like to do a single update to the object instead of two. can we pass params to a transition ? how would you suggest to do this ?

thanks for the gem!

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

No branches or pull requests

1 participant