This question is very similar to this one , although it is slightly different
I just wanted to emphasize that some answer to the above question also suggested adding restrictions to the routes, so you can send requests to various actions of the controller!
Credits to the author, vss123
We decided to use advanced restrictions in rails.
The idea is to have the same path (and therefore the same named route & action), but with routing restrictions on different actions.
resources :plan do post :save, constraints: CommitParamRouting.new("Propose"), action: :propose post :save, constraints: CommitParamRouting.new("Finalize"), action: :finalize end
Is CommitParamRouting a simple class that has a method? which returns true if the commit parameter matches the given attr instance. value.
It is available as a commit_param_matching gem.
Cyril Duchon-Doris
source share