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

Categories

I am building a RESTful Rails service with various CRUD endpoints. On one of the Create endpoints, the data I am passing in includes:

...
action: "action_name"
...

The problem I am having is that params[:action] contains "create", not the actual value of the action parameter I'm passing in. This, I assume, is because params[:action] is being populated by Rails automatically.

Is there another way to access this key I am passing in? Am I doing something blatantly stupid?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.0k views
Welcome To Ask or Share your Answers For Others

1 Answer

Its awkward to use this, but if ever its required, you can get the info using:

 request.POST

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...