Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
195 views
in Technique[技术] by (71.8m points)

ruby on rails - resource_params with custom action for http post

using the jsonapi-utils gives us a helper resource_params which will include all permitted data from active record params. Having a custom route for post, makes resource_params an empty hash.

Is it possible to have the resource_params for a custom action?

Example Code (Pseudo)

jsonapi_resources :token_validation, only: :create do
  post :for_password, on: :collection
end
question from:https://stackoverflow.com/questions/65941961/resource-params-with-custom-action-for-http-post

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...