Parameters
Q: How to get each data that is POST and GET type?
A: Rails does not make any distinction between query string parameters and POST parameters, and both are available in the params hash in your controller.
parameters
Request
GET /persons?me[]=student&me[]=worker&me[]=newbie
In controller
params[:me] = ["student", "worker", "newbie"]
PARAMETERS
Request
POST /persons HTTP 1.1\r\n
HOST: ex.kr\r\n
Content-Type: application/json\r\n
\r\n
{"information": {"name": "acme", "addr": "123" }}
In controller
params[:information] = {name: "acme", addr: "123"}
PARAMETERS
Routing Parameters
get '/clients/:type' => 'clients#index', who: 'me!' # in route.rb
Request
GET /clients/hogang
In controller
params[:who] = "me!"
params[:type] = "hogang"
PARAMETERS
Routing Parameters
get '/clients/:type' => 'clients#index', who: 'me!' # in route.rb
Request
GET /clients/hogang?who=you!
In controller
params[:who] = "???"
PARAMETERS
Routing Parameters
get '/clients/:type' => 'clients#index', who: 'me!' # in route.rb
Request
GET /clients/hogang?who=you!
In controller
params[:who] = "me!"