Skip to content

How to call transitions from controllers/api #57

@f-g-p

Description

@f-g-p

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions