Here is my code in controller:
def login
@user = params[:user]
render :json => @user
end
And here is my POST data:
{
"user": {
"email":"2",
"password":2
}
}
But I can only retrieve a JSON like:
{
"email": "2",
"password": 2
}
How can I parse JSON by params for both email and password, and use the parameter like
params[:email]
params[:password]
so that i can compare my params to the database. Thanks a lot!