$.ajax({
type: 'POST',
url: '/users',
data: {
_method : 'PUT',
user : {
guides : {
step1 : true,
step2 : true
}
}
}
});
Is this saving correctly? I want this json data in a rails serialized field but It's saving incorrectly as follows below which is causing errors.
User.guided:
--- "{\"step1\"=>\"true\", \"step2\"=>\"true\"}"
Then when I do the following in the rails view:
guides = [<%= current_user.guides.try(:html_safe)%>];
It outputs with =>
instead of the expected :
.