In a specific controller I have the below list of params:
Parameters: {"user"=>"{\"id\":32,\"email\":\"test@test.com\",\"created_at\":\"2014-04-10T13:13:40.000Z\",\"updated_at\":\"2014-04-11T18:10:15.000Z\"}"}
How I can get the value of email for example?
You value looks like json.
So try this
user_params = ActiveSupport::JSON.decode(params[:user])
user_params[:email]
or
require 'json'
user_params = JSON.parse(params[:user])
user_params[:email]
You can do
params[:user][:email] #=> "test@test.com"
Which gives you the params of email
attribute of user
.