So I am sending some data from my React Frontend to Rails Backend and I can access the data by using the syntax request.raw_post or request.body and the data which I can see in the console after printing these two objects is

 Parameters: {"email"=>"ramdevukd@gmail.com", "name"=>"Ram Maheshwari", "access_token"=>"oFuiXzsRlzP4F3g-LRqUg8Y9ULI4jLkfPqDmfU9b4ge4vC4EGo", "user"=>{"name"=>"Ram Maheshwari", "email"=>"ramdevukd@gmail.com", "access_token"=>"IqSq6zuIG1QcMJugACzhU74QI4iCKEFwoFuiXzsRlzP4F3g-LRqUg8Y9ULI4jLkfPqDmfU9b4ge4ia8H42jQNmptUfXddJdSJt5G4EGo"}}

But the Question is how do I get access to properties like email, name, access_token, etc. I am not able to access them individually to store in my database Please Help me

  • 4
    params[:email]... This is usually the first thing you learn in any tutorial. – max Oct 21 at 15:02
  • 2
    Adding to @max's comment, you should read up on how Rails parameters work. You'll get more out of those two links than you will any answer to this question. – anothermh Oct 21 at 15:47
  • @max Thank you so much, I am able to access the data using params[:value] – Ram Maheshwari Oct 21 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.